Ignore:
Timestamp:
01/18/09 19:45:20 (15 years ago)
Author:
mattausch
Message:

working on viz for submission

File:
1 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp

    r3284 r3285  
    384384void LoadPompeiiFloor(); 
    385385 
     386float pvsTotalSamples = .0f; 
     387float pvsTotalTime = .0f; 
     388 
    386389 
    387390// new view projection matrix of the camera 
     
    11311134#endif 
    11321135 
    1133 /* 
     1136                /* 
    11341137                ///////////////////////// 
    11351138                //-- update animations 
     
    12301233        glEnableClientState(GL_VERTEX_ARRAY); 
    12311234 
    1232         if (1 && usePvs) 
     1235        if (usePvs) 
    12331236        { 
    12341237                if (!viewCellsTree)      
    12351238                { 
     1239                        LoadVisibilitySolution(); 
    12361240                        applicationTimer.Start(); 
    1237                         LoadVisibilitySolution(); 
    12381241                } 
    12391242 
     
    14711474                Debug << "camPosition=" << camera->GetPosition().x << " " << camera->GetPosition().y << " " << camera->GetPosition().z << endl; 
    14721475                Debug << "camDirection=" << camera->GetDirection().x << " " << camera->GetDirection().y << " " << camera->GetDirection().z << endl; 
     1476                Debug << "lightDirection=" << light->GetDirection().x << " " << light->GetDirection().y << " " << light->GetDirection().z << endl; 
    14731477 
    14741478                CleanUp(); 
     
    17871791                { 
    17881792                        cout << "replaying path" << endl; 
     1793 
    17891794                        currentReplayFrame = -1; 
     1795 
     1796                        // hack: load pvs on replay (remove later!) 
     1797                        usePvs = true; 
    17901798                } 
    17911799                else 
     
    22112219        static float rTime = 1000.0f; 
    22122220 
    2213         // the render time used up purely for the traversal algorithm using glfinish 
    2214         if (showAlgorithmTime) 
    2215         { 
    2216                 if (algTime < 500) renderTime = algTime * expFactor + (1.0f - expFactor) * renderTime; 
    2217         } 
     2221        // the render time is used only for the traversal algorithm using glfinish 
     2222        if (algTime < 500) renderTime = algTime * expFactor + (1.0f - expFactor) * renderTime; 
     2223         
    22182224 
    22192225        accumulatedTime += elapsedTime; 
     
    22242230 
    22252231                if (frameTime) fps = 1e3f / (float)frameTime; 
    2226  
    22272232                rTime = renderTime; 
    22282233 
     
    23762381                        , "CHC" 
    23772382                        , "CHC ++" 
    2378 //                      , "Collector" 
     2383            //, "Collector" 
    23792384                }; 
    23802385         
     
    23962401                int mrays = (int)shotRays / 1000000; 
    23972402                sprintf(msg[7], "%s:  %04d M rays", alg_str[renderMode], mrays);         
    2398                 myfont.DrawString(msg[7], 1.3f, 690.0f, 760.0f);//, top_color, bottom_color); 
     2403                //myfont.DrawString(msg[7], 1.3f, 690.0f, 760.0f);//, top_color, bottom_color); 
     2404                myfont.DrawString(msg[7], 1.3f, winWidth - 350, winHeight - 30.0f);//, top_color, bottom_color); 
    23992405#endif 
    24002406        } 
     
    26582664        viewCell = viewCellsTree->GetViewCell(camera->GetPosition()); 
    26592665 
    2660         // assume 60 FPS and 1M rays per second 
    2661         const float scale = 1e6f / 60.0f; 
     2666        // assume 60 FPS 
     2667        const float raysPerMs = pvsTotalSamples / pvsTotalTime; 
     2668        const float scale = renderTime * raysPerMs; 
     2669 
     2670        cout << "rays per sec: " << raysPerMs << endl; 
    26622671 
    26632672        //const float elapsedAlgorithmTime = applicationTimer.Elapsedms(false); 
     
    26692678        { 
    26702679                PvsEntry entry = viewCell->mPvs.GetEntry(i); 
    2671  
    2672                 if (1)//(entry.mTimeStamp < 0.0f) || (entry.mTimeStamp <= shotRays)) 
     2680#ifdef USE_TIMESTAMPS 
     2681                if ((entry.mTimeStamp < 0.0f) || (entry.mTimeStamp <= shotRays)) 
     2682#else 
     2683                if (1) 
     2684#endif 
    26732685                { 
    26742686                        entry.mEntity->SetVisibleId(globalVisibleId); 
     
    26922704        VisibilitySolutionLoader visLoader; 
    26932705 
    2694         viewCellsTree = visLoader.Load(vis_filename, bvh, viewCellsScaleFactor); 
     2706        viewCellsTree = visLoader.Load(vis_filename,  
     2707                                           bvh, 
     2708                                                                   pvsTotalSamples, 
     2709                                                                   pvsTotalTime, 
     2710                                                                   viewCellsScaleFactor); 
    26952711 
    26962712        if (!viewCellsTree) 
Note: See TracChangeset for help on using the changeset viewer.