Changeset 2980 for GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp
- Timestamp:
- 09/29/08 10:33:56 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp
r2978 r2980 40 40 #include "SkyPreetham.h" 41 41 #include "Texture.h" 42 #include "EntityMerger.h" 42 43 43 44 … … 58 59 /// the renderable scene geometry 59 60 SceneEntityContainer sceneEntities; 61 SceneEntityContainer sceneEntities2; 60 62 // traverses and renders the hierarchy 61 63 RenderTraverser *traverser = NULL; … … 262 264 263 265 264 265 266 ///////// 266 267 //-- cg stuff … … 449 450 } 450 451 451 452 452 SceneEntityContainer::const_iterator sit, sit_end = sceneEntities.end(); 453 454 int merged = 0; 455 456 SceneEntity *oldEnt = NULL; 457 458 cout << "merging entities .. " << endl; 459 460 for (sit = sceneEntities.begin(); sit < sit_end; ++ sit) 461 { 462 SceneEntity *newEnt = (*sit); 463 464 if (!newEnt->GetTransform()->IsIdentity()) 465 { 466 sceneEntities2.push_back(newEnt); 467 continue; 468 } 469 470 if (oldEnt) 471 { 472 EntityMerger merger(newEnt, oldEnt); 473 SceneEntity *ent = merger.Merge(); 474 475 sceneEntities2.push_back(ent); 476 477 oldEnt = NULL; 478 479 ++ merged; 480 } 481 else 482 { 483 oldEnt = newEnt; 484 } 485 } 486 487 if (oldEnt && oldEnt->GetTransform()->IsIdentity()) 488 sceneEntities2.push_back(oldEnt); 489 490 cout << "merged " << merged << " of " << (int)sceneEntities.size() << " entities " << endl; 491 453 492 // set far plane based on scene extent 454 493 farDist = 10.0f * Magnitude(bvh->GetBox().Diagonal()); … … 611 650 { 612 651 PrintGLerror("fbo start"); 652 613 653 // this fbo basicly stores the scene information we get from standard rendering of a frame 614 654 // we store colors, normals, positions (for the ssao) … … 1096 1136 { 1097 1137 // actually render the scene geometry using the specified algorithm 1098 traverser->RenderScene(); 1138 //traverser->RenderScene(); 1139 1099 1140 /* 1100 1141 state.Reset(); 1101 1142 aeroplane->Render(&state); 1102 1103 SceneEntityContainer::const_iterator sit, sit_end = sceneEntities.end(); 1143 */ 1144 1145 #if 0 1146 SceneEntityContainer::const_iterator sit, sit_end = sceneEntities.end(); 1104 1147 1105 1148 for (sit = sceneEntities.begin(); sit != sit_end; ++ sit) 1106 {1107 1149 renderQueue->Enqueue(*sit); 1108 } 1109 1150 #else 1151 1152 SceneEntityContainer::const_iterator sit, sit_end = sceneEntities2.end(); 1153 1154 for (sit = sceneEntities2.begin(); sit != sit_end; ++ sit) 1155 renderQueue->Enqueue(*sit); 1156 #endif 1110 1157 renderQueue->Apply(); 1111 */1112 1158 } 1113 1159 … … 1115 1161 ///////// 1116 1162 //-- do the rest of the rendering 1117 1118 1163 1119 1164 // reset depth pass and render visible objects … … 1772 1817 DEL_PTR(fbo); 1773 1818 DEL_PTR(ssaoShader); 1819 1820 CLEAR_CONTAINER(sceneEntities2); 1774 1821 1775 1822 if (sCgMrtVertexProgram) … … 2085 2132 state.SetUseAlphaToCoverage(false); 2086 2133 2087 // change CHC++ set of state variables (must be done for each change of camera because 2134 // change CHC++ set of state variables 2135 // this must be done for each change of camera because 2088 2136 // otherwise the temporal coherency is broken 2089 2137 BvhNode::SetCurrentState(1);
Note: See TracChangeset
for help on using the changeset viewer.