Changeset 113 for trunk/VUT/Ogre
- Timestamp:
- 05/27/05 11:56:51 (20 years ago)
- Location:
- trunk/VUT/Ogre
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/Ogre/include/OgreVisibilityOctreeSceneManager.h
r112 r113 60 60 bool mUseVisibilityCulling; 61 61 bool mShowVisualization; 62 bool mRenderNodesForViz;63 62 bool mVisualizeCulledNodes; 63 64 int mRenderNodesForViz; 64 65 }; 65 66 -
trunk/VUT/Ogre/include/OgreVisibilityTerrainSceneManager.h
r112 r113 50 50 */ 51 51 GtpVisibility::VisibilityManager *getVisibilityManager(); 52 52 53 53 protected: 54 54 … … 63 63 bool mShowVisualization; 64 64 bool mRenderNodesForViz; 65 bool mRenderNodesContentForViz; 65 66 bool mVisualizeCulledNodes; 66 67 }; -
trunk/VUT/Ogre/src/OgreOctreeHierarchyInterface.cpp
r112 r113 3 3 #include <OgreOctree.h> 4 4 #include <OgreLogManager.h> 5 5 #include <OgreStringConverter.h> 6 6 #include <windows.h> 7 7 … … 156 156 box->setMaterial("QueryCulledNodesMaterial"); 157 157 } 158 158 159 static_cast<OctreeSceneManager *>(mSceneManager)->getBoxes()->push_back(box); 159 //LogManager::getSingleton().logMessage("pushing box");160 160 } 161 161 } // namespace Ogre -
trunk/VUT/Ogre/src/OgrePlatformHierarchyInterface.cpp
r112 r113 12 12 mCamera(NULL), mCullCamera(NULL), mOnlyShadowCasters(false) 13 13 { 14 CreateCulledNodeMaterials();15 16 14 } 17 15 //----------------------------------------------------------------------- … … 20 18 // material for frustum culled nodes 21 19 MaterialPtr mat = MaterialManager::getSingleton().getByName("FrustumCulledNodesMaterial"); 22 MaterialPtr baseWhite = MaterialManager::getSingleton().getByName("BaseWhiteNoLighting");20 23 21 if (mat.isNull()) 24 22 { 25 23 mat = MaterialManager::getSingleton().create("FrustumCulledNodesMaterial", 26 24 ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME); 27 28 //baseWhite.get()->copyDetailsTo(mat); 29 //mat->setColourWriteEnabled(true); 30 mat->setLightingEnabled(false); 31 //mat->setAmbient(ColourValue(1,0,0)); 25 mat->createTechnique()->createPass(); 26 27 mat->getTechnique(0)->getPass(0)->setAmbient(1,0,0); 28 mat->getTechnique(0)->getPass(0)->setLightingEnabled(true); 29 //mat->getTechnique(0)->getPass(0)->setDepthCheckEnabled(false); 30 31 mat->load(); 32 32 } 33 33 34 34 // material for query culled nodes 35 MaterialPtr mat2= MaterialManager::getSingleton().getByName("QueryCulledNodesMaterial");36 37 if (mat 2.isNull())38 { 39 mat 2= MaterialManager::getSingleton().create("QueryCulledNodesMaterial",35 mat = MaterialManager::getSingleton().getByName("QueryCulledNodesMaterial"); 36 37 if (mat.isNull()) 38 { 39 mat = MaterialManager::getSingleton().create("QueryCulledNodesMaterial", 40 40 ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME); 41 //baseWhite.get()->copyDetailsTo(mat2); 42 // mat2->setColourWriteEnabled(true); 43 mat2->setLightingEnabled(false); 44 //mat2->setAmbient(ColourValue(0,0,1)); 41 mat->createTechnique()->createPass(); 42 43 mat->getTechnique(0)->getPass(0)->setAmbient(0,0,1); 44 mat->getTechnique(0)->getPass(0)->setLightingEnabled(true); 45 mat->load(); 45 46 } 46 47 } … … 126 127 SetCullCamera(cam); 127 128 } 129 130 CreateCulledNodeMaterials(); 128 131 } 129 132 //----------------------------------------------------------------------- -
trunk/VUT/Ogre/src/OgreVisibilityOctreeSceneManager.cpp
r112 r113 142 142 if (key == "RenderNodesForViz") 143 143 { 144 mRenderNodesForViz = (*static_cast<const bool*>(val));144 mRenderNodesForViz = (*static_cast<const int *>(val)); 145 145 return true; 146 146 } -
trunk/VUT/Ogre/src/OgreVisibilityTerrainSceneManager.cpp
r112 r113 20 20 mShowVisualization(false), 21 21 mRenderNodesForViz(false), 22 mRenderNodesContentForViz(false), 22 23 mVisualizeCulledNodes(false) 23 24 { … … 39 40 void VisibilityTerrainSceneManager::_findVisibleObjects(Camera* cam, bool onlyShadowCasters) 40 41 { 42 // only shadow casters will be rendered in shadow texture pass 41 43 mHierarchyInterface->SetOnlyShadowCasters(onlyShadowCasters); 44 42 45 // does nothing if hierarchical culling is used => 43 46 // we interleave identification and rendering of objects … … 64 67 // ignore 65 68 } 66 67 for (NodeList::iterator it = mVisible.begin(); it != mVisible.end(); ++it)69 70 if (mRenderNodesForViz || mRenderNodesContentForViz) 68 71 { 69 MaterialPtr mp = (*it)->getMaterial(); 70 71 mp.get()->setLightingEnabled(false); 72 mp.get()->setAmbient(ColourValue(1,0,0)); 73 mp.get()->setDiffuse(ColourValue(1,1,1)); 74 mp.get()->setSpecular(ColourValue(1,1,1)); 75 76 mp.get()->getTechnique(0)->getPass(0)->removeAllTextureUnitStates(); 77 //*mp = MaterialManager::getSingleton().getByName("BaseWhiteNoLighting"); 78 //(*it)->setMaterialName("BaseWhiteNoLighting"); 79 getRenderQueue()->addRenderable(*it); 80 81 if (mRenderNodesForViz) 72 // change node material so it is better suited for visualization 73 MaterialPtr nodeMat = MaterialManager::getSingleton().getByName("Core/NodeMaterial"); 74 nodeMat->setAmbient(1, 1, 0); 75 nodeMat->setLightingEnabled(true); 76 nodeMat->getTechnique(0)->getPass(0)->removeAllTextureUnitStates(); 77 78 for (NodeList::iterator it = mVisible.begin(); it != mVisible.end(); ++it) 82 79 { 83 (*it)->_addToRenderQueue(cam, getRenderQueue(), false); 80 if (mRenderNodesForViz) 81 { 82 getRenderQueue()->addRenderable(*it); 83 } 84 if (mRenderNodesContentForViz) 85 { 86 (*it)->_addToRenderQueue(cam, getRenderQueue(), false); 87 } 84 88 } 85 89 } … … 109 113 if (!mUseVisibilityCulling || mShowVisualization) 110 114 { 115 //mDestRenderSystem->unbindGpuProgram(GPT_VERTEX_PROGRAM); 116 //mDestRenderSystem->unbindGpuProgram(GPT_FRAGMENT_PROGRAM); 111 117 TerrainSceneManager::_renderVisibleObjects(); 112 118 … … 179 185 { 180 186 mRenderNodesForViz = (*static_cast<const bool *>(val)); 187 return true; 188 } 189 if (key == "RenderNodesContentForViz") 190 { 191 mRenderNodesContentForViz = (*static_cast<const bool *>(val)); 181 192 return true; 182 193 }
Note: See TracChangeset
for help on using the changeset viewer.