- Timestamp:
- 05/31/05 00:57:01 (19 years ago)
- Location:
- trunk/VUT
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/GtpVisibility/src/CoherentHierarchicalCullingManager.cpp
r115 r119 8 8 { 9 9 //InitFrame(); 10 //Ogre::LogManager::getSingleton().logMessage("chc culling");11 10 QueryQueue queryQueue; 12 11 unsigned int visiblePixels = 0; -
trunk/VUT/Ogre/include/OgreVisibilityOctreeSceneManager.h
r118 r119 64 64 protected: 65 65 /** Creates material for depth pass, e.g., a pass that only fills the depth buffer */ 66 void CreateDepthPass();66 void InitDepthPass(); 67 67 void ShowVisualization(Camera *cam); 68 68 OctreeHierarchyInterface *mHierarchyInterface; -
trunk/VUT/Ogre/include/OgreVisibilityTerrainSceneManager.h
r118 r119 64 64 protected: 65 65 /** Creates material for depth pass, e.g., a pass that only fills the depth buffer */ 66 void CreateDepthPass();66 void InitDepthPass(); 67 67 void ShowVisualization(Camera *cam); 68 68 OctreeHierarchyInterface *mHierarchyInterface; -
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.