Changeset 119 for trunk/VUT/Ogre/src
- Timestamp:
- 05/31/05 00:57:01 (19 years ago)
- Location:
- trunk/VUT/Ogre/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/Ogre/src/OgreVisibilityOctreeSceneManager.cpp
r118 r119 34 34 // TODO: find reasonable value for max depth 35 35 mMaxDepth = 50; 36 37 CreateDepthPass(); 38 } 39 //----------------------------------------------------------------------- 40 void VisibilityOctreeSceneManager::CreateDepthPass() 36 } 37 //----------------------------------------------------------------------- 38 void VisibilityOctreeSceneManager::InitDepthPass() 41 39 { 42 40 MaterialPtr depthMat = MaterialManager::getSingleton().getByName("Visibility/DepthPass"); … … 69 67 // setting vertex program is not efficient 70 68 //Pass *usedPass = ((mIsDepthPass && !pass->hasVertexProgram()) ? mDepthPass : pass); 71 Pass *usedPass = (mIsDepthPass ? mDepthPass : pass); 69 // set depth fill pass only if depth write enabled 70 Pass *usedPass = (mIsDepthPass && pass->getDepthWriteEnabled() ? mDepthPass : pass); 72 71 73 72 if (mIsDepthPass) … … 166 165 void VisibilityOctreeSceneManager::_renderVisibleObjects() 167 166 { 167 // create material for depth pass 168 InitDepthPass(); 169 168 170 // visualization: apply standard rendering 169 171 if (mShowVisualization) -
trunk/VUT/Ogre/src/OgreVisibilityTerrainSceneManager.cpp
r118 r119 32 32 // TODO: set maxdepth to reasonable value 33 33 mMaxDepth = 50; 34 // create material for depth pass 35 CreateDepthPass(); 36 } 37 //----------------------------------------------------------------------- 38 void VisibilityTerrainSceneManager::CreateDepthPass() 34 } 35 //----------------------------------------------------------------------- 36 void VisibilityTerrainSceneManager::InitDepthPass() 39 37 { 40 38 MaterialPtr depthMat = MaterialManager::getSingleton().getByName("Visibility/DepthPass"); … … 64 62 Pass *VisibilityTerrainSceneManager::setPass(Pass* pass) 65 63 { 66 // setting vertex program is not efficient 67 //Pass *usedPass = ((mIsDepthPass && !pass->hasVertexProgram()) ? mDepthPass : pass); 68 Pass *usedPass = (mIsDepthPass ? mDepthPass : pass); 64 // set depth fill pass only if depth write enabled 65 Pass *usedPass = (mIsDepthPass && pass->getDepthWriteEnabled() ? mDepthPass : pass); 69 66 70 67 if (mIsDepthPass) 71 68 { 69 //if (pass->isTransparent()) return pass; 70 72 71 // set vertex program of current pass 73 if (pass->hasVertexProgram() )72 if (pass->hasVertexProgram() && (pass->getVertexProgramName() != mDepthPass->getVertexProgramName())) 74 73 { 75 74 mDepthPass->setVertexProgram(pass->getVertexProgramName()); … … 79 78 const GpuProgramPtr& prg = mDepthPass->getVertexProgram(); 80 79 // Load this program if not done already 81 if (!prg->isLoaded()) 82 prg->load(); 80 if (!prg->isLoaded()) prg->load(); 83 81 // Copy params 84 82 mDepthPass->setVertexProgramParameters(pass->getVertexProgramParameters()); … … 163 161 void VisibilityTerrainSceneManager::_renderVisibleObjects() 164 162 { 163 // create material for depth pass 164 InitDepthPass(); 165 165 166 // visualization: apply standard rendering 166 167 if (mShowVisualization) … … 225 226 if (mUseDepthPass) 226 227 { 227 for (NodeList::iterator it = mVisible.begin(); it != mVisible.end(); ++it)228 /*for (NodeList::iterator it = mVisible.begin(); it != mVisible.end(); ++it) 228 229 { 229 230 (*it)->_addToRenderQueue(mCameraInProgress, getRenderQueue(), false); 230 } 231 }*/ 231 232 mIsDepthPass = false; 232 233 }
Note: See TracChangeset
for help on using the changeset viewer.