Changeset 1597 for GTP/trunk/Lib
- Timestamp:
- 10/10/06 09:05:48 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreOcclusionCullingSceneManager.cpp
r1595 r1597 168 168 // ignore 169 169 } 170 170 171 // add bounding boxes of rendered objects 171 172 if (0) … … 175 176 } 176 177 177 MovableObjectsMap::const_iterator mit, mit_end = mViewCellsGeometry.end(); 178 /* 179 for (mit = mViewCellsGeometry.begin(); mit != mit_end; ++ mit) 180 { 181 (*mit).second->_updateRenderQueue(getRenderQueue()); 182 } 183 */ 184 185 if (mRenderNodesForViz || mRenderNodesContentForViz) 178 // set old view cell geometry to invisible 179 if (mCurrentViewCell && mCurrentViewCell->GetMesh()) 180 { 181 const int id = mCurrentViewCell->GetId(); 182 mViewCellsGeometry[id]->_updateRenderQueue(getRenderQueue()); 183 } 184 185 if (mRenderNodesForViz || mRenderNodesContentForViz) 186 186 { 187 187 // HACK: change node material so it is better suited for visualization … … 195 195 if (mRenderNodesForViz) 196 196 { 197 // render the leaf nodes197 // render the visible leaf nodes 198 198 if ((*it)->numAttachedObjects() && 199 199 !(*it)->numChildren() && … … 201 201 (*it)->getAttachedObject(0)->isVisible()) 202 202 { 203 getRenderQueue()->addRenderable((*it)); 203 //getRenderQueue()->addRenderable((*it)); 204 (*it)->_addToRenderQueue(cam, getRenderQueue(), false); 204 205 } 205 206 206 // add bounding boxes instead of node itself207 // add bounding boxes instead of node itself 207 208 //(*it)->_addBoundingBoxToQueue(getRenderQueue()); 208 209 } 209 210 210 211 // add renderables itself 211 if ( mRenderNodesContentForViz)212 if (0 && mRenderNodesContentForViz) 212 213 { 213 214 (*it)->_addToRenderQueue(cam, getRenderQueue(), false); … … 296 297 bool onlyShadowCasters) 297 298 { 299 /////////// 300 //-- set visibility according to pvs of current view cell 301 302 UpdatePvs(cam); 303 298 304 if (mNormalExecution) 299 305 { … … 311 317 else 312 318 { 313 // for hierarchical culling, we interleaveidentification319 // hierarchical culling interleaves identification 314 320 // and rendering of objects in _renderVisibibleObjects 315 321 316 322 // for the shadow pass we use only standard rendering 317 // because of low occlusion323 // because shadows have low occlusion snyway 318 324 if (mShadowTechnique == SHADOWTYPE_TEXTURE_MODULATIVE && 319 325 mIlluminationStage == IRS_RENDER_TO_TEXTURE) … … 324 330 // only shadow casters will be rendered in shadow texture pass 325 331 if (0) mHierarchyInterface->SetOnlyShadowCasters(onlyShadowCasters); 326 327 ///////////328 //-- apply view cell pvs329 UpdatePvs(cam);330 332 } 331 333 … … 453 455 } 454 456 } 457 /*const bool mVisualizeViewCells = true; 458 if (mVisualizeViewCells) 459 { 460 MovableObjectsMap::const_iterator mit, mit_end = mViewCellsGeometry.end(); 461 462 for (mit = mViewCellsGeometry.begin(); mit != mit_end; ++ mit) 463 { 464 (*mit).second->_updateRenderQueue(getRenderQueue()); 465 } 466 }*/ 455 467 456 468 ///////////// 457 469 //-- now we can render all remaining queue objects 458 470 //-- used for depth pass, transparents, overlay 459 clearSpecialCaseRenderQueues(); 471 472 clearSpecialCaseRenderQueues(); 460 473 461 474 TerrainSceneManager::_renderVisibleObjects(); … … 714 727 // Do transparents (always descending) 715 728 renderObjects(pPriorityGrp->getTransparents(), 716 QueuedRenderableCollection::OM_SORT_DESCENDING, true);729 QueuedRenderableCollection::OM_SORT_DESCENDING, true); 717 730 } 718 731 … … 1029 1042 // Sort the queue first 1030 1043 pPriorityGrp->sort(mCameraInProgress); 1031 1032 1044 // Do (shadowable) solids 1033 1045 OctreeSceneManager::renderObjects(pPriorityGrp->getSolidsBasic(), om, true); … … 1118 1130 1119 1131 mElementaryViewCell = newElementary; 1120 LogManager::getSingleton().logMessage("unloading"); 1121 1122 std::stringstream d; 1123 d << "here2 " << mViewCellsGeometry.size(); 1124 LogManager::getSingleton().logMessage(d.str()); 1132 1125 1133 1126 1134 ////////////// … … 1128 1136 1129 1137 ApplyViewCellPvs(mCurrentViewCell, false); 1130 1131 // set old view cell geometry to invisible1132 if (mCurrentViewCell && mCurrentViewCell->GetMesh())1133 {1134 const int id = mCurrentViewCell->GetId();1135 1136 std::stringstream str;1137 str << "id : " << id << " of " << mViewCellsGeometry.size();1138 LogManager::getSingleton().logMessage(str.str());1139 1140 mViewCellsGeometry[id]->setVisible(false);1141 }1142 1138 1143 1139 // the new view cell … … 1155 1151 else 1156 1152 { 1157 viewCell = newElementary; LogManager::getSingleton().logMessage("here55");1153 viewCell = newElementary; 1158 1154 } 1159 1155 1160 1156 /////////////// 1161 1157 //-- load new pvs 1162 1163 // set new view cell geometry to invisible1164 if (viewCell && viewCell->GetMesh())1165 {1166 const int id = viewCell->GetId();1167 1168 std::stringstream str;1169 str << "id : " << id << " of " << mViewCellsGeometry.size();1170 LogManager::getSingleton().logMessage(str.str());1171 1172 mViewCellsGeometry[id]->setVisible(false);1173 }1174 1158 1175 1159 ApplyViewCellPvs(viewCell, true); … … 1200 1184 1201 1185 std::stringstream str; 1202 str << " id : " << viewCell->GetId();1203 1186 str << "processing view cell with id : " << viewCell->GetId(); 1187 LogManager::getSingleton().logMessage(str.str()); 1204 1188 ManualObject *manual = OgreTypeConverter::ConvertToOgre(viewCell->GetMesh(), this); 1205 1189 mViewCellsGeometry[viewCell->GetId()] = manual; … … 1207 1191 // attach to scene node 1208 1192 getRootSceneNode()->createChildSceneNode()->attachObject(manual); 1209 1193 manual->setQueryFlags(0); // returned by no query 1210 1194 // initialy set to invisible 1211 manual->setVisible(false);1195 //manual->setVisible(false); 1212 1196 } 1213 1197 }
Note: See TracChangeset
for help on using the changeset viewer.