Changeset 3285 for GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp
- Timestamp:
- 01/18/09 19:45:20 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp
r3284 r3285 384 384 void LoadPompeiiFloor(); 385 385 386 float pvsTotalSamples = .0f; 387 float pvsTotalTime = .0f; 388 386 389 387 390 // new view projection matrix of the camera … … 1131 1134 #endif 1132 1135 1133 /*1136 /* 1134 1137 ///////////////////////// 1135 1138 //-- update animations … … 1230 1233 glEnableClientState(GL_VERTEX_ARRAY); 1231 1234 1232 if ( 1 &&usePvs)1235 if (usePvs) 1233 1236 { 1234 1237 if (!viewCellsTree) 1235 1238 { 1239 LoadVisibilitySolution(); 1236 1240 applicationTimer.Start(); 1237 LoadVisibilitySolution();1238 1241 } 1239 1242 … … 1471 1474 Debug << "camPosition=" << camera->GetPosition().x << " " << camera->GetPosition().y << " " << camera->GetPosition().z << endl; 1472 1475 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; 1473 1477 1474 1478 CleanUp(); … … 1787 1791 { 1788 1792 cout << "replaying path" << endl; 1793 1789 1794 currentReplayFrame = -1; 1795 1796 // hack: load pvs on replay (remove later!) 1797 usePvs = true; 1790 1798 } 1791 1799 else … … 2211 2219 static float rTime = 1000.0f; 2212 2220 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 2218 2224 2219 2225 accumulatedTime += elapsedTime; … … 2224 2230 2225 2231 if (frameTime) fps = 1e3f / (float)frameTime; 2226 2227 2232 rTime = renderTime; 2228 2233 … … 2376 2381 , "CHC" 2377 2382 , "CHC ++" 2378 //, "Collector"2383 //, "Collector" 2379 2384 }; 2380 2385 … … 2396 2401 int mrays = (int)shotRays / 1000000; 2397 2402 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); 2399 2405 #endif 2400 2406 } … … 2658 2664 viewCell = viewCellsTree->GetViewCell(camera->GetPosition()); 2659 2665 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; 2662 2671 2663 2672 //const float elapsedAlgorithmTime = applicationTimer.Elapsedms(false); … … 2669 2678 { 2670 2679 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 2673 2685 { 2674 2686 entry.mEntity->SetVisibleId(globalVisibleId); … … 2692 2704 VisibilitySolutionLoader visLoader; 2693 2705 2694 viewCellsTree = visLoader.Load(vis_filename, bvh, viewCellsScaleFactor); 2706 viewCellsTree = visLoader.Load(vis_filename, 2707 bvh, 2708 pvsTotalSamples, 2709 pvsTotalTime, 2710 viewCellsScaleFactor); 2695 2711 2696 2712 if (!viewCellsTree)
Note: See TracChangeset
for help on using the changeset viewer.