Changeset 112 for trunk/VUT/Ogre
- Timestamp:
- 05/25/05 18:28:46 (20 years ago)
- Location:
- trunk/VUT/Ogre
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/Ogre/include/OgreOctreeHierarchyInterface.h
r87 r112 43 43 unsigned int LastVisited(GtpVisibility::HierarchyNode *node) const; 44 44 45 void VisualizeCulledNode(GtpVisibility::HierarchyNode *node, 46 GtpVisibility::CullingType type); 47 45 48 protected: 46 49 /** Returns pointer to the bounding box of the node. -
trunk/VUT/Ogre/include/OgrePlatformHierarchyInterface.h
r111 r112 86 86 87 87 protected: 88 /** materials for visualizing frustum and query culled nodes */ 89 void CreateCulledNodeMaterials(); 90 88 91 /** A pass that prepares an occlusion query. 89 92 @remark disables depth write, colour write, lighting, -
trunk/VUT/Ogre/include/OgreSceneNodeHierarchyInterface.h
r87 r112 35 35 36 36 AxisAlignedBox *GetBoundingBox(GtpVisibility::HierarchyNode *node); 37 38 void VisualizeCulledNode(GtpVisibility::HierarchyNode *node, 39 GtpVisibility::CullingType type); 37 40 }; 38 41 -
trunk/VUT/Ogre/include/OgreVisibilityOctreeSceneManager.h
r100 r112 60 60 bool mUseVisibilityCulling; 61 61 bool mShowVisualization; 62 bool mRenderNodesForViz; 63 bool mVisualizeCulledNodes; 62 64 }; 63 65 -
trunk/VUT/Ogre/include/OgreVisibilitySceneManager.h
r103 r112 59 59 bool mUseVisibilityCulling; 60 60 bool mShowVisualization; 61 62 bool mVisualizeCulledNodes; 61 63 }; 62 64 } // namespace Ogre -
trunk/VUT/Ogre/include/OgreVisibilityTerrainSceneManager.h
r103 r112 63 63 bool mShowVisualization; 64 64 bool mRenderNodesForViz; 65 bool mVisualizeCulledNodes; 65 66 }; 66 67 -
trunk/VUT/Ogre/src/OgreOctreeHierarchyInterface.cpp
r103 r112 142 142 return &mBox; 143 143 } 144 //----------------------------------------------------------------------- 145 void OctreeHierarchyInterface::VisualizeCulledNode(GtpVisibility::HierarchyNode *node, 146 GtpVisibility::CullingType type) 147 { 148 WireBoundingBox *box = static_cast<Octree *>(node)->getWireBoundingBox(); 144 149 150 if (type == GtpVisibility::FRUSTUM_CULLED) 151 { 152 box->setMaterial("FrustumCulledNodesMaterial"); 153 } 154 else // type == GtpVisibility::QUERY_CULLED 155 { 156 box->setMaterial("QueryCulledNodesMaterial"); 157 } 158 static_cast<OctreeSceneManager *>(mSceneManager)->getBoxes()->push_back(box); 159 //LogManager::getSingleton().logMessage("pushing box"); 160 } 145 161 } // namespace Ogre -
trunk/VUT/Ogre/src/OgrePlatformHierarchyInterface.cpp
r111 r112 12 12 mCamera(NULL), mCullCamera(NULL), mOnlyShadowCasters(false) 13 13 { 14 CreateCulledNodeMaterials(); 15 16 } 17 //----------------------------------------------------------------------- 18 void PlatformHierarchyInterface::CreateCulledNodeMaterials() 19 { 20 // material for frustum culled nodes 21 MaterialPtr mat = MaterialManager::getSingleton().getByName("FrustumCulledNodesMaterial"); 22 MaterialPtr baseWhite = MaterialManager::getSingleton().getByName("BaseWhiteNoLighting"); 23 if (mat.isNull()) 24 { 25 mat = MaterialManager::getSingleton().create("FrustumCulledNodesMaterial", 26 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)); 32 } 33 34 // material for query culled nodes 35 MaterialPtr mat2 = MaterialManager::getSingleton().getByName("QueryCulledNodesMaterial"); 36 37 if (mat2.isNull()) 38 { 39 mat2 = MaterialManager::getSingleton().create("QueryCulledNodesMaterial", 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)); 45 } 14 46 } 15 47 //----------------------------------------------------------------------- … … 162 194 // Set colour write mode off 163 195 mRenderSystem->_setColourBufferWriteEnabled(false, false, false, false); 164 // Set colour write mode pff165 mRenderSystem->_setColourBufferWriteEnabled(false, false, false, false);166 196 } 167 197 //----------------------------------------------------------------------- … … 177 207 { 178 208 mOnlyShadowCasters = onlyShadowCasters; 179 mDummy= mOnlyShadowCasters ;209 //mIsShadowPass = mOnlyShadowCasters ; 180 210 } 181 211 //----------------------------------------------------------------------- -
trunk/VUT/Ogre/src/OgreSceneContentGenerator.cpp
r111 r112 87 87 { 88 88 Matrix3 mat; 89 mat.FromEulerAnglesYXZ(Degree(rotation.x),//.valueRadians(), 90 Degree(rotation.y),//.valueRadians(), 91 Degree(rotation.z));//.valueRadians()); 89 mat.FromEulerAnglesYXZ(Degree(rotation.x), Degree(rotation.y), 90 Degree(rotation.z)); 92 91 93 92 return GenerateSceneObject(position, Quaternion(mat), objName); -
trunk/VUT/Ogre/src/OgreSceneNodeHierarchyInterface.cpp
r103 r112 124 124 return &mBox; 125 125 } 126 //----------------------------------------------------------------------- 127 void SceneNodeHierarchyInterface::VisualizeCulledNode(GtpVisibility::HierarchyNode *node, 128 GtpVisibility::CullingType type) 129 { 130 // TODO 131 } 126 132 } // namespace Ogre -
trunk/VUT/Ogre/src/OgreVisibilityOctreeSceneManager.cpp
r103 r112 12 12 VisibilityOctreeSceneManager::VisibilityOctreeSceneManager( 13 13 GtpVisibility::VisibilityManager *visManager) 14 : mVisibilityManager(visManager), mUseVisibilityCulling(true), 15 mShowVisualization(false) 14 : 15 mVisibilityManager(visManager), 16 mUseVisibilityCulling(true), 17 mShowVisualization(false), 18 mRenderNodesForViz(false), 19 mVisualizeCulledNodes(false) 16 20 { 17 21 mHierarchyInterface = … … 37 41 mCullCamera ? getCamera("CullCamera") : NULL); 38 42 39 // call initframe to reset culling manager stats40 mVisibilityManager->GetCullingManager()->InitFrame();41 42 // standard terrain scenemanager rendering without hierarchical culling43 if (!mUseVisibilityCulling || mShowVisualization)44 { 45 OctreeSceneManager::_renderVisibleObjects();46 return;47 } 43 if (!mShowVisualization) 44 { 45 // two cameras (one for culling, one for rendering) 46 mHierarchyInterface->InitFrame(mOctree, mCameraInProgress, 47 mCullCamera ? getCamera("CullCamera") : NULL); 48 49 // call initframe to reset culling manager stats 50 mVisibilityManager->GetCullingManager()->InitFrame(mVisualizeCulledNodes); 51 } 48 52 49 53 //-- hierarchical culling … … 136 140 return true; 137 141 } 142 if (key == "RenderNodesForViz") 143 { 144 mRenderNodesForViz = (*static_cast<const bool *>(val)); 145 return true; 146 } 147 if (key == "SkyBoxEnabled") 148 { 149 mSkyBoxEnabled = (*static_cast<const bool *>(val)); 150 return true; 151 } 152 if (key == "SkyPlaneEnabled") 153 { 154 mSkyPlaneEnabled = (*static_cast<const bool *>(val)); 155 return true; 156 } 157 if (key == "SkyDomeEnabled") 158 { 159 mSkyDomeEnabled = (*static_cast<const bool *>(val)); 160 return true; 161 } 162 if (key == "VisualizeCulledNodes") 163 { 164 mVisualizeCulledNodes = (*static_cast<const bool *>(val)); 165 return true; 166 } 138 167 return VisibilityOptionsManager(mVisibilityManager, mHierarchyInterface). 139 168 setOption(key, val) || OctreeSceneManager::setOption(key, val); -
trunk/VUT/Ogre/src/OgreVisibilitySceneManager.cpp
r111 r112 38 38 void VisibilitySceneManager::_renderVisibleObjects() 39 39 { 40 // two cameras (one for culling, one for rendering) 41 mHierarchyInterface->InitFrame(mSceneRoot, mCameraInProgress); 40 if (!mShowVisualization) 41 { 42 // two cameras (one for culling, one for rendering) 43 mHierarchyInterface->InitFrame(mSceneRoot, mCameraInProgress); 42 44 43 // call initframe to reset culling manager stats 44 mVisibilityManager->GetCullingManager()->InitFrame(); 45 // call initframe to reset culling manager stats 46 mVisibilityManager->GetCullingManager()->InitFrame(mVisualizeCulledNodes); 47 } 45 48 46 49 // standard terrain scenemanager rendering without hierarchical culling … … 48 51 { 49 52 SceneManager::_renderVisibleObjects(); 53 50 54 return; 51 55 } 52 56 53 57 //-- hierarchical culling 54 58 // the objects of different layers (e.g., background, scene, -
trunk/VUT/Ogre/src/OgreVisibilityTerrainSceneManager.cpp
r111 r112 19 19 mUseVisibilityCulling(true), 20 20 mShowVisualization(false), 21 mRenderNodesForViz(false) 21 mRenderNodesForViz(false), 22 mVisualizeCulledNodes(false) 22 23 { 23 24 mHierarchyInterface = … … 66 67 for (NodeList::iterator it = mVisible.begin(); it != mVisible.end(); ++it) 67 68 { 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"); 68 79 getRenderQueue()->addRenderable(*it); 69 80 … … 85 96 void VisibilityTerrainSceneManager::_renderVisibleObjects() 86 97 { 87 88 98 if (!mShowVisualization) 89 99 { … … 93 103 94 104 // call initframe to reset culling manager stats 95 mVisibilityManager->GetCullingManager()->InitFrame( );96 } 97 105 mVisibilityManager->GetCullingManager()->InitFrame(mVisualizeCulledNodes); 106 } 107 98 108 // standard terrain scenemanager rendering without hierarchical culling 99 109 if (!mUseVisibilityCulling || mShowVisualization) … … 184 194 { 185 195 mSkyDomeEnabled = (*static_cast<const bool *>(val)); 196 return true; 197 } 198 if (key == "VisualizeCulledNodes") 199 { 200 mVisualizeCulledNodes = (*static_cast<const bool *>(val)); 186 201 return true; 187 202 }
Note: See TracChangeset
for help on using the changeset viewer.