Changeset 133 for trunk/VUT/Ogre


Ignore:
Timestamp:
06/15/05 01:18:51 (20 years ago)
Author:
mattausch
Message:

fixed some bugs

Location:
trunk/VUT/Ogre
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/VUT/Ogre/include/OgreVisibilityTerrainSceneManager.h

    r130 r133  
    7272        void renderQueueGroupObjects(RenderQueueGroup* pGroup); 
    7373 
    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        */ 
    7576        Entity* createEntity(const String& entityName, const String& meshName); 
    7677 
    77         /** Returns pointer to visibility manager */ 
     78        /** Returns pointer to visibility manager. 
     79        */ 
    7880        GtpVisibility::VisibilityManager *GetVisibilityManager(); 
    7981 
    8082protected: 
    8183         
    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        */ 
    8386        void InitDepthPass(); 
    84         /** Creates material for item buffer. */ 
     87        /** Creates material for item buffer.  
     88        */ 
    8589        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        */ 
    8792        void ShowVisualization(Camera *cam); 
    8893 
     
    100105        bool mRenderDepthPass; 
    101106        bool mRenderItemBuffer; 
     107        bool mEnableDepthWrite; 
    102108 
    103109        Pass *mDepthPass; 
  • trunk/VUT/Ogre/src/OgrePlatformHierarchyInterface.cpp

    r130 r133  
    188188        else 
    189189        { 
     190                // used by the scene manager, because bounding box rendering must be handled 
     191                // differently 
    190192                mIsBoundingBoxQuery = true; 
    191193 
  • trunk/VUT/Ogre/src/OgreVisibilitySceneManagerDll.cpp

    r121 r133  
    4646 
    4747//----------------------------------------------------------------------- 
    48 extern "C" void dllStartPlugin(void) 
     48extern "C" void __declspec(dllexport) dllStartPlugin(void) 
    4949{ 
    5050        visEnv = new GtpVisibility::VisibilityEnvironment(); 
     
    6666} 
    6767//----------------------------------------------------------------------- 
    68 extern "C" void dllStopPlugin() 
     68extern "C" void __declspec(dllexport) dllShutdownPlugin() 
     69{ 
     70        visibilityTerrainPlugin->shutdown(); 
     71        heightmapTerrainPageSource->shutdown(); 
     72} 
     73//----------------------------------------------------------------------- 
     74extern "C" void __declspec(dllexport) dllStopPlugin() 
    6975{ 
    7076        delete heightmapTerrainPageSource; 
     
    7783        delete visEnv; 
    7884} 
    79 //----------------------------------------------------------------------- 
    80 extern "C" void dllShutdownPlugin() 
    81 { 
    82         visibilityTerrainPlugin->shutdown(); 
    83         heightmapTerrainPageSource->shutdown(); 
    84 } 
     85 
    8586 
    8687} //namespace Ogre 
  • trunk/VUT/Ogre/src/OgreVisibilityTerrainSceneManager.cpp

    r130 r133  
    2525mUseDepthPass(false), 
    2626mRenderItemBuffer(false), 
    27 mCurrentEntityId(0) 
     27mCurrentEntityId(0), 
     28mEnableDepthWrite(true) 
    2829{ 
    2930        mHierarchyInterface = new OctreeHierarchyInterface(this, mDestRenderSystem); 
     
    145146         
    146147        // 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); 
    148150                 
    149151        IlluminationRenderStage savedStage = mIlluminationStage;  
     
    158160        if (mRenderDepthPass) 
    159161        { 
    160                 // set vertex program of current pass 
     162                // --- set vertex program of current pass so z-buffer is updated correctly 
    161163        if (pass->hasVertexProgram()) 
    162164                { 
     
    178180                } 
    179181        } 
     182 
     183        bool IsDepthWrite = usedPass->getDepthWriteEnabled(); 
     184        // global option which enables / disables depth writes 
     185        if (!mEnableDepthWrite) 
     186        { 
     187                usedPass->setDepthWriteEnabled(false); 
     188        } 
     189 
    180190        //else if (mIsItemBufferPass) {usedPass = mItemBufferPass;} 
    181191         
    182192        Pass *result = SceneManager::setPass(usedPass); 
     193 
     194        // reset depth write 
     195        if (!mEnableDepthWrite) 
     196        { 
     197                usedPass->setDepthWriteEnabled(IsDepthWrite); 
     198        } 
    183199 
    184200        // reset illumination stage 
     
    191207{ 
    192208        // 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         
    199212        //-- show visible scene nodes and octree bounding boxes from last frame 
    200213        if (mShowVisualization) 
     
    374387        { 
    375388                TerrainRenderable::setCurrentRenderLevelIndex((*static_cast<const int *>(val))); 
     389                return true; 
     390        } 
     391        if (key == "DepthCheck") 
     392        { 
     393                mEnableDepthWrite = (*static_cast<const bool *>(val)); 
    376394                return true; 
    377395        } 
     
    508526        } 
    509527 
    510         // ----- TRANSPARENT LOOP: must be handlet differently altough we don't really 
    511         // care about transparents for the item buffer 
     528        // ----- TRANSPARENT LOOP: must be handled differently  
     529        // although we don't really     care about transparents for the item buffer 
    512530        // TODO: HOW TO HANDLE OCCLUDED OBJECTS ???? 
    513531        RenderPriorityGroup::TransparentRenderablePassList 
Note: See TracChangeset for help on using the changeset viewer.