Changeset 3251
- Timestamp:
- 01/06/09 15:18:41 (16 years ago)
- Location:
- GTP/trunk/App/Demos/Vis/FriendlyCulling
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/FriendlyCulling/default.env
r3250 r3251 61 61 ## powerplant options 62 62 63 filename=PowerPlantM63 #filename=PowerPlantM 64 64 65 keyForwardMotion=500.0f66 mouseMotion=3.0f;67 visibilitySolution=power-plant-2c-xx-1000b-pgv268 camPosition=-1320.57 -6306.34 360369 camDirection=0.292156 0.9556 0.038387865 #keyForwardMotion=500.0f 66 #mouseMotion=3.0f; 67 #visibilitySolution=power-plant-2c-xx-1000b-pgv2 68 #camPosition=-1320.57 -6306.34 3603 69 #camDirection=0.292156 0.9556 0.0383878 70 70 71 71 -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/CHCPlusPlusTraverser.cpp
r3065 r3251 119 119 mDistanceQueue.pop(); 120 120 121 if (1 && !IsNodeVisible(node, 10)) 122 { 123 node->SetVisible(false); 124 continue; 125 } 126 121 127 if (mBvh->IsWithinViewFrustum(node)) 122 128 { … … 143 149 // node was not recently tested => reset flag 144 150 if (node->GetLastVisitedFrame() != mFrameId - 1) 151 { 145 152 node->SetTimesTestedInvisible(0); 153 } 146 154 147 155 // update node's visited flag … … 162 170 else 163 171 { 172 // node is leaf => set to visible 164 173 if (node->IsVirtualLeaf()) 165 174 { … … 175 184 // always traverse a node if it was previously visible 176 185 if (wasVisible) 186 { 177 187 TraverseNode(node); 188 } 178 189 } 179 190 } -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/CHCTraverser.cpp
r3065 r3251 121 121 // always traverse a node if it was visible 122 122 if (wasVisible) 123 { 123 124 TraverseNode(node); 125 } 124 126 } 125 127 } -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/FrustumCullingTraverser.cpp
r3071 r3251 18 18 mDistanceQueue.pop(); 19 19 20 if (1 && !IsNodeVisible(node, 10)) 21 { 22 node->SetVisible(false); 23 continue; 24 } 25 20 26 if (mBvh->IsWithinViewFrustum(node)) 21 27 { -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/RenderTraverser.cpp
r3245 r3251 291 291 } 292 292 293 } 293 294 bool RenderTraverser::IsNodeVisible(BvhNode *node, int maxSize) 295 { 296 // no invisible objects 297 if (SceneEntity::GetGlobalVisibleId() == -1) return true; 298 299 int geometrySize; 300 SceneEntity **entities = mBvh->GetGeometry(node, geometrySize); 301 302 if (geometrySize > maxSize) return true; 303 304 for (int i = 0; i < geometrySize; ++ i) 305 { 306 if (entities[i]->IsVisible()) return true; 307 } 308 309 return false; 310 } 311 312 313 } -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/RenderTraverser.h
r3147 r3251 168 168 */ 169 169 void ApplyRenderQueue(); 170 171 bool IsNodeVisible(BvhNode *node, int maxSize); 170 172 171 173 -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/SceneEntity.h
r3245 r3251 120 120 static void SetGlobalVisibleId(int id); 121 121 122 static int GetGlobalVisibleId(); 123 122 124 protected: 125 123 126 124 127 /** Internally updates current lod level. … … 219 222 220 223 224 inline int SceneEntity::GetGlobalVisibleId() 225 { 226 return sVisibleId; 227 } 228 229 221 230 inline int SceneEntity::GetVisibleId(int id) const 222 231 { -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/ShaderManager.cpp
r3147 r3251 68 68 sCgFragmentProfile = cgGLGetLatestProfile(CG_GL_FRAGMENT); 69 69 //sCgFragmentProfile = CG_PROFILE_GPU_FP; 70 //CG_PROFILE_FP40;; 70 if (sCgFragmentProfile == CG_PROFILE_FP40) 71 cout << "cg profile: fp40" << endl; 72 else 73 cout << "cg profile " << sCgFragmentProfile << endl; 74 71 75 cgGLSetOptimalOptions(sCgFragmentProfile); 72 76 // get the optimal vertex profile -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/ViewCellsTree.cpp
r3250 r3251 15 15 16 16 // hack: this has to be set to 0.05f for powerplant, to 1 otherwise 17 static const float sScale = 0.05f;18 //static const float sScale = 1.0f;17 //static const float sScale = 0.05f; 18 static const float sScale = 1.0f; 19 19 20 20 -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp
r3250 r3251 466 466 texHeight = winHeight; 467 467 468 cout << "assumed VisibleFrames: " << assumedVisibleFrames << endl;469 cout << "max BatchSize: " << maxBatchSize << endl;470 cout << "triangles PerVirtualLeaf: " << trianglesPerVirtualLeaf << endl;471 472 cout << "key ForwardMotion: " << keyForwardMotion << endl;473 cout << "key Rotation: " << keyRotation << endl;474 cout << "win Width: " << winWidth << endl;475 cout << "win Height: " << winHeight << endl;476 cout << "use FullScreen: " << useFullScreen << endl;477 cout << "use LODs: " << useLODs << endl;478 cout << "cam Position: " << camPos << endl;468 cout << "assumed visible frames: " << assumedVisibleFrames << endl; 469 cout << "max batch size: " << maxBatchSize << endl; 470 cout << "triangles per virtual leaf: " << trianglesPerVirtualLeaf << endl; 471 472 cout << "key forward motion: " << keyForwardMotion << endl; 473 cout << "key rotation: " << keyRotation << endl; 474 cout << "win width: " << winWidth << endl; 475 cout << "win height: " << winHeight << endl; 476 cout << "use full screen: " << useFullScreen << endl; 477 cout << "use LODs: " << useLODs << endl; 478 cout << "camera position: " << camPos << endl; 479 479 cout << "shadow size: " << shadowSize << endl; 480 480 cout << "render method: " << renderMethod << endl; … … 483 483 cout << "use advanced shading: " << useAdvancedShading << endl; 484 484 cout << "turbitity: " << turbitity << endl; 485 cout << "temporal coherence : " << ssaoTempCohFactor << endl;485 cout << "temporal coherence factor: " << ssaoTempCohFactor << endl; 486 486 cout << "sample intensity: " << ssaoSampleIntensity << endl; 487 487 cout << "kernel radius: " << ssaoKernelRadius << endl; 488 cout << " ssao full resolution: " << ssaoUseFullResolution << endl;488 cout << "use ssao full resolution: " << ssaoUseFullResolution << endl; 489 489 cout << "recorded frames suffix: " << recordedFramesSuffix << endl; 490 490 cout << "stats filename: " << statsFilename << endl; 491 cout << " filename: " << filename << endl;492 cout << "use PVS : " << usePvs << endl;493 cout << "visibility Solution: " << visibilitySolution << endl;494 cout << "use SkylightForIllum" << useSkylightForIllum << endl;491 cout << "static scene filename prefix: " << filename << endl; 492 cout << "use PVSs: " << usePvs << endl; 493 cout << "visibility solution: " << visibilitySolution << endl; 494 cout << "use skylight for illumination: " << useSkylightForIllum << endl; 495 495 496 496 //cout << "model path: " << model_path << endl; … … 1190 1190 glEnableClientState(GL_VERTEX_ARRAY); 1191 1191 1192 if ( usePvs)1192 if (0 && usePvs) 1193 1193 { 1194 1194 if (!viewCellsTree) LoadVisibilitySolution(); 1195 1196 1195 LoadPvs(); 1197 1196 } … … 1276 1275 else 1277 1276 { 1277 if (usePvs) 1278 { 1279 if (!viewCellsTree) LoadVisibilitySolution(); 1280 LoadPvs(); 1281 } 1282 else 1278 1283 // actually render the scene geometry using the specified algorithm 1279 1284 traverser->RenderScene(); … … 2302 2307 sprintf(msg[i ++], "traversed: %5d, frustum culled: %5d, query culled: %5d", 2303 2308 traversedNodes, frustumCulledNodes, queryCulledNodes); 2304 sprintf(msg[i ++], "issued queries: %5d, renderstate changes: %5d, render batches: %5d",2309 sprintf(msg[i ++], "issued queries: %5d, state changes: %5d, render batches: %5d", 2305 2310 issuedQueries, stateChanges, numBatches); 2306 2311 … … 2580 2585 int numTriangles = 0; 2581 2586 2587 SceneEntity::SetGlobalVisibleId(globalVisibleId); 2588 2582 2589 for (int i = 0; i < viewCell->mPvs.Size(); ++ i) 2583 2590 { 2584 2591 SceneEntity *ent = viewCell->mPvs.GetEntry(i); 2592 2585 2593 ent->SetVisibleId(globalVisibleId); 2594 ent->Render(&renderState); 2586 2595 2587 2596 numTriangles += ent->CountNumTriangles(); 2588 2597 } 2589 2598 2590 SceneEntity::SetGlobalVisibleId(globalVisibleId ++);2599 ++ globalVisibleId; 2591 2600 } 2592 2601 -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaderenv.h
r3247 r3251 63 63 64 64 65 //#define USE_GTX65 #define USE_GTX 66 66 67 67 #endif // __SHADERENV_H
Note: See TracChangeset
for help on using the changeset viewer.