Changeset 133 for trunk/VUT/Ogre
- Timestamp:
- 06/15/05 01:18:51 (20 years ago)
- Location:
- trunk/VUT/Ogre
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/Ogre/include/OgreVisibilityTerrainSceneManager.h
r130 r133 72 72 void renderQueueGroupObjects(RenderQueueGroup* pGroup); 73 73 74 /** Override from SceneManager so that sub entities can be assigned an id for item buffer */ 74 /** Override from SceneManager so that sub entities can be assigned an id for item buffer. 75 */ 75 76 Entity* createEntity(const String& entityName, const String& meshName); 76 77 77 /** Returns pointer to visibility manager */ 78 /** Returns pointer to visibility manager. 79 */ 78 80 GtpVisibility::VisibilityManager *GetVisibilityManager(); 79 81 80 82 protected: 81 83 82 /** Creates material for depth pass, e.g., a pass that only fills the depth buffer. */ 84 /** Creates material for depth pass, e.g., a pass that only fills the depth buffer. 85 */ 83 86 void InitDepthPass(); 84 /** Creates material for item buffer. */ 87 /** Creates material for item buffer. 88 */ 85 89 void InitItemBufferPass(); 86 /** Fills render queue so that a visualization can be rendered. */ 90 /** Fills render queue so that a visualization can be rendered. 91 */ 87 92 void ShowVisualization(Camera *cam); 88 93 … … 100 105 bool mRenderDepthPass; 101 106 bool mRenderItemBuffer; 107 bool mEnableDepthWrite; 102 108 103 109 Pass *mDepthPass; -
trunk/VUT/Ogre/src/OgrePlatformHierarchyInterface.cpp
r130 r133 188 188 else 189 189 { 190 // used by the scene manager, because bounding box rendering must be handled 191 // differently 190 192 mIsBoundingBoxQuery = true; 191 193 -
trunk/VUT/Ogre/src/OgreVisibilitySceneManagerDll.cpp
r121 r133 46 46 47 47 //----------------------------------------------------------------------- 48 extern "C" void dllStartPlugin(void)48 extern "C" void __declspec(dllexport) dllStartPlugin(void) 49 49 { 50 50 visEnv = new GtpVisibility::VisibilityEnvironment(); … … 66 66 } 67 67 //----------------------------------------------------------------------- 68 extern "C" void dllStopPlugin() 68 extern "C" void __declspec(dllexport) dllShutdownPlugin() 69 { 70 visibilityTerrainPlugin->shutdown(); 71 heightmapTerrainPageSource->shutdown(); 72 } 73 //----------------------------------------------------------------------- 74 extern "C" void __declspec(dllexport) dllStopPlugin() 69 75 { 70 76 delete heightmapTerrainPageSource; … … 77 83 delete visEnv; 78 84 } 79 //----------------------------------------------------------------------- 80 extern "C" void dllShutdownPlugin() 81 { 82 visibilityTerrainPlugin->shutdown(); 83 heightmapTerrainPageSource->shutdown(); 84 } 85 85 86 86 87 } //namespace Ogre -
trunk/VUT/Ogre/src/OgreVisibilityTerrainSceneManager.cpp
r130 r133 25 25 mUseDepthPass(false), 26 26 mRenderItemBuffer(false), 27 mCurrentEntityId(0) 27 mCurrentEntityId(0), 28 mEnableDepthWrite(true) 28 29 { 29 30 mHierarchyInterface = new OctreeHierarchyInterface(this, mDestRenderSystem); … … 145 146 146 147 // set depth fill pass only if depth write enabled 147 Pass *usedPass = (mRenderDepthPass && !mHierarchyInterface->IsBoundingBoxQuery() ? mDepthPass : pass); 148 Pass *usedPass = (mRenderDepthPass && !mHierarchyInterface->IsBoundingBoxQuery() ? 149 mDepthPass : pass); 148 150 149 151 IlluminationRenderStage savedStage = mIlluminationStage; … … 158 160 if (mRenderDepthPass) 159 161 { 160 // set vertex program of current pass162 // --- set vertex program of current pass so z-buffer is updated correctly 161 163 if (pass->hasVertexProgram()) 162 164 { … … 178 180 } 179 181 } 182 183 bool IsDepthWrite = usedPass->getDepthWriteEnabled(); 184 // global option which enables / disables depth writes 185 if (!mEnableDepthWrite) 186 { 187 usedPass->setDepthWriteEnabled(false); 188 } 189 180 190 //else if (mIsItemBufferPass) {usedPass = mItemBufferPass;} 181 191 182 192 Pass *result = SceneManager::setPass(usedPass); 193 194 // reset depth write 195 if (!mEnableDepthWrite) 196 { 197 usedPass->setDepthWriteEnabled(IsDepthWrite); 198 } 183 199 184 200 // reset illumination stage … … 191 207 { 192 208 // needs full ambient lighting for item colors to be exact 193 if (mRenderItemBuffer) 194 { 195 setAmbientLight(ColourValue(1,1,1,1)); 196 } 197 //getRenderQueue()->clear(); 198 209 /*if (mRenderItemBuffer) 210 { setAmbientLight(ColourValue(1,1,1,1)); }*/ 211 199 212 //-- show visible scene nodes and octree bounding boxes from last frame 200 213 if (mShowVisualization) … … 374 387 { 375 388 TerrainRenderable::setCurrentRenderLevelIndex((*static_cast<const int *>(val))); 389 return true; 390 } 391 if (key == "DepthCheck") 392 { 393 mEnableDepthWrite = (*static_cast<const bool *>(val)); 376 394 return true; 377 395 } … … 508 526 } 509 527 510 // ----- TRANSPARENT LOOP: must be handle t differently altough we don't really511 // care about transparents for the item buffer528 // ----- TRANSPARENT LOOP: must be handled differently 529 // although we don't really care about transparents for the item buffer 512 530 // TODO: HOW TO HANDLE OCCLUDED OBJECTS ???? 513 531 RenderPriorityGroup::TransparentRenderablePassList
Note: See TracChangeset
for help on using the changeset viewer.