- Timestamp:
- 01/18/09 19:45:20 (16 years ago)
- Location:
- GTP/trunk/App/Demos/Vis/FriendlyCulling
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/FriendlyCulling/default.env
r3284 r3285 21 21 shadowSize=4096 22 22 # the filenames given to recorded frames (+ number.bmp) 23 recordedFramesSuffix= image23 recordedFramesSuffix=frames/vienna_frame 24 24 # the filename for the statistics 25 25 statsFilename=mystats … … 80 80 81 81 #lightDirection=-0.8f 1.0f -0.7f 82 lightDirection=-0.3f 0.2f -0.7f83 82 #lightDirection=-0.3f 0.2f -0.7f 83 lightDirection=-0.14002 0.812842 -0.565404 84 84 85 85 ##################### 86 86 ## window options 87 87 88 #winWidth=80089 #winHeight=60088 winWidth=800 89 winHeight=600 90 90 91 winWidth=102492 winHeight=76891 #winWidth=1024 92 #winHeight=768 93 93 94 94 useFullScreen=0 … … 121 121 122 122 # use full resolution ssao (vs. half resoltion) 123 ssaoUseFullResolution= 0123 ssaoUseFullResolution=1 124 124 # ssao kernel radius 125 125 #ssaoKernelRadius=8e-1f … … 141 141 #bvhname=PowerPlantM 142 142 #keyForwardMotion=500.0f 143 #mouseMotion=10.0f 143 144 #visibilitySolution=power-plant-2c-xx-1000b-pgv2 144 145 #visibilitySolution=power-plant-2c-xx-1000d-pgv 146 #visibilitySolution=power-plant-2c-xx-1000b-spgvu 145 147 #camPosition=-1320.57 -6306.34 3603 146 148 #camDirection=0.292156 0.9556 0.0383878 -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/Pvs.cpp
r3284 r3285 10 10 bool operator<(const PvsEntry &a, const PvsEntry &b) 11 11 { 12 //return a.mTimeStamp < b.mTimeStamp; 12 #ifdef USE_TIMESTAMPS 13 return a.mTimeStamp < b.mTimeStamp; 14 #else 13 15 return true; 16 #endif 14 17 } 15 18 … … 29 32 void Pvs::Sort() 30 33 { 34 // TODO 31 35 } 32 36 -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/Pvs.h
r3284 r3285 11 11 class Bvh; 12 12 13 #define USE_TIMESTAMPS 14 13 15 struct PvsEntry 14 16 { 15 17 PvsEntry(SceneEntity *ent, float t): 16 18 mEntity(ent) 17 //, mTimeStamp(t) 19 #ifdef USE_TIMESTAMPS 20 , mTimeStamp(t) 21 #endif 18 22 {} 19 23 … … 24 28 25 29 SceneEntity *mEntity; 26 //float mTimeStamp; 30 #ifdef USE_TIMESTAMPS 31 float mTimeStamp; 32 #endif 27 33 }; 28 34 -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/VisibilitySolutionLoader.cpp
r3284 r3285 18 18 ViewCellsTree *VisibilitySolutionLoader::Load(const std::string &filename, 19 19 Bvh *bvh, 20 float viewCellsScaleFactor) 20 float &totalSamples, 21 float &totalTime, 22 float viewCellsScaleFactor 23 ) 21 24 { 22 25 FILE *fr = fopen(filename.c_str(), "rb"); … … 30 33 } 31 34 32 float totalSamples;33 float totalTime;34 35 35 fread(&totalSamples, sizeof(float), 1, fr); 36 36 fread(&totalTime, sizeof(float), 1, fr); … … 157 157 CreateIdSortedList2(bvh->GetStaticRoot(), nodes); 158 158 //CreateIdSortedList(bvh, nodes); 159 ofstream outstream("test.log");159 /* ofstream outstream("test.log"); 160 160 161 161 BvhNode *f = ((BvhInterior *)bvh->GetStaticRoot())->GetFront(); … … 179 179 } 180 180 } 181 181 */ 182 182 for (int i = 0; i < number; ++ i) 183 183 { 184 if ((i % number / 10) == (number / 10 - 1)) 185 cout << 100 * (i + 1) / 100 << "percent loaded" << endl; 186 184 187 fread(&entries, sizeof(int), 1, fw); 185 188 … … 193 196 194 197 BvhNode *node = nodes[objectId]; 195 if (i == 100) 196 outstream << "t " << time << " "; 198 //if (i == 100) outstream << "t " << time << " "; 197 199 mViewCells[i]->mPvs.AddEntry(bvh, node, time); 198 200 } 199 201 } 200 202 201 outstream.close();203 //outstream.close(); 202 204 203 205 return true; -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/VisibilitySolutionLoader.h
r3279 r3285 24 24 VisibilitySolutionLoader(): mNumNodes(0) {}; 25 25 26 ViewCellsTree *Load(const std::string &filename, Bvh *bvh, float viewCellsScaleFactor = 1.0f); 26 ViewCellsTree *Load(const std::string &filename, 27 Bvh *bvh, 28 float &totalSamples, 29 float &totalTime, 30 float viewCellsScaleFactor = 1.0f); 27 31 28 32 -
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) -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaderenv.h
r3275 r3285 7 7 8 8 //#define NUM_SAMPLES 8 9 #define NUM_SAMPLES 1610 //#define NUM_SAMPLES 249 //#define NUM_SAMPLES 16 10 #define NUM_SAMPLES 24 11 11 //#define NUM_SAMPLES 48 12 12 -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/combineSsao.cg
r3271 r3285 115 115 float4 ao = tex2Dlod(ssaoTex, float4(IN.texCoord, 0, 0)); 116 116 117 #if 1 // usehalf resolution117 #if 0 // for half resolution 118 118 119 119 // the following has to be done for half resolution ssao:
Note: See TracChangeset
for help on using the changeset viewer.