Changeset 114 for trunk/VUT/Ogre/src
- Timestamp:
- 05/27/05 18:59:23 (19 years ago)
- Location:
- trunk/VUT/Ogre/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/Ogre/src/OgreVisibilityOctreeSceneManager.cpp
r113 r114 17 17 mShowVisualization(false), 18 18 mRenderNodesForViz(false), 19 mVisualizeCulledNodes(false) 19 mVisualizeCulledNodes(false), 20 mRenderTransparentObjects(false) 20 21 { 21 22 mHierarchyInterface = … … 92 93 void VisibilityOctreeSceneManager::_findVisibleObjects(Camera* cam, bool onlyShadowCasters) 93 94 { 94 // if shadow pass => render only shadow casters95 // only shadow casters will be rendered in shadow texture pass 95 96 mHierarchyInterface->SetOnlyShadowCasters(onlyShadowCasters); 96 97 97 98 // does nothing if hierarchical culling is used => 98 99 // we interleave identification and rendering of objects 99 // in _renderVisibibleObjects 100 // in _renderVisibibleObjects 100 101 if (!mUseVisibilityCulling) 101 102 { … … 103 104 return; 104 105 } 105 106 107 //-- show visibile scene nodes and octree bounding boxes from last frame 106 108 if (mShowVisualization) 107 109 { 110 // add player camera for visualization purpose 111 try { 112 Camera *c; 113 if ((c = getCamera("PlayerCam")) != NULL) 114 { 115 getRenderQueue()->addRenderable(c); 116 } 117 } 118 catch(...) 119 { 120 // ignore 121 } 108 122 109 for ( BoxList::iterator it = mBoxes.begin(); it != mBoxes.end(); ++it ) 123 if (mRenderNodesForViz || mRenderNodesContentForViz) 124 { 125 // change node material so it is better suited for visualization 126 /* MaterialPtr nodeMat = MaterialManager::getSingleton().getByName("Core/NodeMaterial"); 127 nodeMat->setAmbient(1, 1, 0); 128 nodeMat->setLightingEnabled(true); 129 nodeMat->getTechnique(0)->getPass(0)->removeAllTextureUnitStates();*/ 130 131 for (NodeList::iterator it = mVisible.begin(); it != mVisible.end(); ++it) 132 { 133 if (mRenderNodesForViz) 134 { 135 getRenderQueue()->addRenderable(*it); 136 } 137 if (mRenderNodesContentForViz) 138 { 139 (*it)->_addToRenderQueue(cam, getRenderQueue(), false); 140 } 141 } 142 } 143 for (BoxList::iterator it = mBoxes.begin(); it != mBoxes.end(); ++it) 110 144 { 111 145 getRenderQueue()->addRenderable(*it); 112 146 } 113 147 } 114 115 m Boxes.clear();116 m Visible.clear();148 149 mVisible.clear(); 150 mBoxes.clear(); 117 151 } 118 152 //----------------------------------------------------------------------- … … 142 176 if (key == "RenderNodesForViz") 143 177 { 144 mRenderNodesForViz = (*static_cast<const int*>(val));178 mRenderNodesForViz = (*static_cast<const bool *>(val)); 145 179 return true; 146 180 } … … 165 199 return true; 166 200 } 201 167 202 return VisibilityOptionsManager(mVisibilityManager, mHierarchyInterface). 168 203 setOption(key, val) || OctreeSceneManager::setOption(key, val); … … 200 235 { 201 236 return mVisibilityManager; 237 } 238 //----------------------------------------------------------------------- 239 void VisibilityOctreeSceneManager::renderObjects(const RenderPriorityGroup::TransparentRenderablePassList& objs, 240 bool doLightIteration, const LightList* manualLightList) 241 { 242 if (mRenderTransparentObjects) 243 { 244 OctreeSceneManager::renderObjects(objs, doLightIteration, manualLightList); 245 } 202 246 } 203 247 //----------------------------------------------------------------------- -
trunk/VUT/Ogre/src/OgreVisibilityTerrainSceneManager.cpp
r113 r114 21 21 mRenderNodesForViz(false), 22 22 mRenderNodesContentForViz(false), 23 mVisualizeCulledNodes(false) 23 mVisualizeCulledNodes(false), 24 mRenderTransparentObjects(false) 24 25 { 25 26 mHierarchyInterface = 26 27 new OctreeHierarchyInterface(this, mDestRenderSystem); 27 28 28 29 //mDisplayNodes = true; 29 30 //mShowBoundingBoxes = true; 30 31 … … 71 72 { 72 73 // change node material so it is better suited for visualization 73 MaterialPtr nodeMat = MaterialManager::getSingleton().getByName("Core/NodeMaterial");74 /*MaterialPtr nodeMat = MaterialManager::getSingleton().getByName("Core/NodeMaterial"); 74 75 nodeMat->setAmbient(1, 1, 0); 75 76 nodeMat->setLightingEnabled(true); 76 nodeMat->getTechnique(0)->getPass(0)->removeAllTextureUnitStates(); 77 nodeMat->getTechnique(0)->getPass(0)->removeAllTextureUnitStates();*/ 77 78 78 79 for (NodeList::iterator it = mVisible.begin(); it != mVisible.end(); ++it) … … 113 114 if (!mUseVisibilityCulling || mShowVisualization) 114 115 { 115 //mDestRenderSystem->unbindGpuProgram(GPT_VERTEX_PROGRAM);116 //mDestRenderSystem->unbindGpuProgram(GPT_FRAGMENT_PROGRAM);117 116 TerrainSceneManager::_renderVisibleObjects(); 118 117 … … 248 247 return mVisibilityManager; 249 248 } 250 251 249 //----------------------------------------------------------------------- 252 250 void VisibilityTerrainSceneManager::WriteLog() … … 264 262 LogManager::getSingleton().logMessage(d.str()); 265 263 } 266 264 //----------------------------------------------------------------------- 265 void VisibilityTerrainSceneManager::renderObjects(const RenderPriorityGroup::TransparentRenderablePassList& objs, 266 bool doLightIteration, const LightList* manualLightList) 267 { 268 if (mRenderTransparentObjects) 269 { 270 OctreeSceneManager::renderObjects(objs, doLightIteration, manualLightList); 271 } 272 } 267 273 268 274 } // namespace Ogre
Note: See TracChangeset
for help on using the changeset viewer.