Ignore:
Timestamp:
05/30/05 03:20:23 (19 years ago)
Author:
mattausch
Message:

added depth pass algorithm + delayed transparent object rendering (so depth ordering is right)

Location:
trunk/VUT/work/ogre_changes/OgreMain
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/VUT/work/ogre_changes/OgreMain/include/OgreHardwareOcclusionQuery.h

    r92 r115  
    9696      * Pulls the hardware occlusion query too see if there is a result. 
    9797      * @retval NumOfFragments will get the resulting number of fragments. 
    98           * @param waitForResult if true, the query will wait until a result is available 
    99       * @return True if success or false if not. 
    100           * @Remarks Hardware occlusion is an assyncronius process the result may take a frame or so. 
    101           *                     one idea is to test pass1 and if not visible skip pass2. Also note that objects 
    102           *                     not visible must be tested evrey frame. Visable objects don't need testing every frame. 
    103           *                     Testing non visable objects can be don unlit, no texture with low LOD object. 
    104           *        0 will generate all the levels till 1x1. [default: 0] 
    105       */ 
    106 #ifdef GTP_VISIBILITY_MODIFIED_OGRE 
    107           virtual bool pullOcclusionQuery( unsigned int* NumOfFragments, const bool waitForResult ) = 0; 
    108 #else 
    109          virtual bool pullOcclusionQuery( unsigned int* NumOfFragments ) = 0; 
    110 #endif 
    111         /** 
    112       * Pulls the hardware occlusion query too see if there is a result. 
    113       * @retval NumOfFragments will get the resulting number of fragments. 
    114           * @param waitForResult if true, the query will wait until a result is available 
    11598      * @return True if success or false if not. 
    11699          * @Remarks In DX9 mode specifying OCCLUSIONQUERY_FLUSH as the flag, will case the driver to flush whatever API calls are batched. 
    117100          * In OpenGL mode it makes no difference if you specify OCCLUSIONQUERY_FLUSH or OCCLUSIONQUERY_NOFLUSH. 
    118101      */ 
    119 #ifdef GTP_VISIBILITY_MODIFIED_OGRE 
    120         virtual bool pullOcclusionQuery( unsigned int* NumOfFragments, const bool waitForResult, 
    121                                                                          const HW_OCCLUSIONQUERY flag  ) = 0;  
    122 #else 
    123           virtual bool pullOcclusionQuery( unsigned int* NumOfFragments,  
    124                                                                            const HW_OCCLUSIONQUERY flag  ) = 0;  
    125 #endif 
     102        virtual bool pullOcclusionQuery(unsigned int* NumOfFragments, const HW_OCCLUSIONQUERY flag = HWOCCLUSIONQUERY_FLUSH) = 0; 
     103 
    126104        /** 
    127105          * Let's you get the last pixel count with out doing the hardware occlusion test 
     
    143121        virtual void    setSkipRate( int skip ) = 0; 
    144122        virtual int             getSkipRate() = 0; 
     123 
     124#ifdef GTP_VISIBILITY_MODIFIED_OGRE 
     125        /** 
     126                Pulls occlusion query. 
     127                @param NumOfFragments number of visible fragments if query result was available. 
     128                Last query result if query result was not yet available. 
     129 
     130                @param waitForResult if true, the function waits until the result is available. 
     131                Otherwise the function returns immediately, not waiting for the result. 
     132                @returns true if query result was available, false if result was not yet available 
     133        */ 
     134        virtual bool pullOcclusionQuery( unsigned int* NumOfFragments, const bool waitForResult,  
     135                const HW_OCCLUSIONQUERY flag = HWOCCLUSIONQUERY_FLUSH ) = 0;  
     136#endif // GTP_VISIBILITY_MODIFIED_OGRE 
     137 
    145138//---------------------------------------------------------------------- 
    146139// Private members 
  • trunk/VUT/work/ogre_changes/OgreMain/include/OgreSceneManager.h

    r74 r115  
    128128                        @param node scene node to be rendered 
    129129                        @param cam current camera 
     130                        @param leaveTransparentsInQueue if only solid objects should be rendered 
    130131                */ 
    131                 void _renderSceneNode( Camera *cam, SceneNode *node ); 
    132                 /** deletes all queues which we were currently processing 
    133                         @remark clears renderqueue after rendering scene node 
     132                void _renderSceneNode(Camera *cam, SceneNode *node, bool leaveTransparentsInQueue = false); 
     133                /** deletes all processed queues 
     134                        @remark clears render queues after rendering scene node 
    134135                */ 
    135                 void _deleteRenderedQueueGroups(); 
     136                void _deleteRenderedQueueGroups(bool leaveTransparentsInQueue); 
    136137                /** Internal method used by _renderVisibleObjects to deal with renderables 
    137138            which override the camera's own view / projection materices.  
  • trunk/VUT/work/ogre_changes/OgreMain/src/OgreSceneManager.cpp

    r99 r115  
    5959#include "OgreDataStream.h" 
    6060#include "OgreStaticGeometry.h" 
    61 #include <windows.h> //matt: remove later 
     61 
    6262// This class implements the most basic scene manager 
    6363 
     
    665665        if (lastUsedVertexProgram) 
    666666        { 
    667                         //matt: remove later 
    668                         //OutputDebugString("unbinding vertex program\n"); 
    669  
    670667            mDestRenderSystem->unbindGpuProgram(GPT_VERTEX_PROGRAM); 
    671668            lastUsedVertexProgram = false; 
     
    990987                               const String& groupName) 
    991988{ 
    992     mSkyPlaneEnabled = enable; 
    993989    if (enable) 
    994990    { 
     
    10611057 
    10621058    } 
     1059        mSkyPlaneEnabled = enable; 
    10631060} 
    10641061//----------------------------------------------------------------------- 
     
    10711068                             const String& groupName) 
    10721069{ 
    1073     mSkyBoxEnabled = enable; 
    10741070    if (enable) 
    10751071    { 
     
    11431139 
    11441140    } 
    1145  
     1141        mSkyBoxEnabled = enable; 
    11461142} 
    11471143//----------------------------------------------------------------------- 
     
    11571153                              const String& groupName) 
    11581154{ 
    1159     mSkyDomeEnabled = enable; 
    11601155    if (enable) 
    11611156    { 
     
    11641159        { 
    11651160            OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS,  
    1166                 "Sky dome material '" + materialName + " not found.", 
     1161                "Sky dome material '" + materialName + "' not found.", 
    11671162                "SceneManager::setSkyDome"); 
    11681163        } 
     
    12081203 
    12091204    } 
     1205        mSkyDomeEnabled = enable; 
    12101206} 
    12111207//----------------------------------------------------------------------- 
     
    26582654    { 
    26592655        Light* l = i->second; 
     2656                if (l->isVisible()) 
     2657                { 
    26602658        if (l->getType() == Light::LT_DIRECTIONAL) 
    26612659        { 
     
    26752673 
    26762674        } 
     2675    } 
    26772676    } 
    26782677 
     
    41804179#ifdef GTP_VISIBILITY_MODIFIED_OGRE 
    41814180//----------------------------------------------------------------------- 
    4182 void SceneManager::_renderSceneNode( Camera *cam, SceneNode *node ) 
     4181void SceneManager::_renderSceneNode(Camera *cam, SceneNode *node, bool leaveTransparentsInQueue) 
    41834182{ 
    41844183        node->_findVisibleObjects(cam, getRenderQueue(), false, mDisplayNodes, false); 
     
    41864185         
    41874186        // delete all rendered objects from renderqueue 
    4188         _deleteRenderedQueueGroups(); 
    4189 } 
    4190 //----------------------------------------------------------------------- 
    4191 void SceneManager::_deleteRenderedQueueGroups() 
     4187        _deleteRenderedQueueGroups(leaveTransparentsInQueue); 
     4188} 
     4189//----------------------------------------------------------------------- 
     4190void SceneManager::_deleteRenderedQueueGroups(bool leaveTransparentsInQueue) 
    41924191{ 
    41934192        RenderQueue::QueueGroupIterator queueIt = getRenderQueue()->_getQueueGroupIterator(); 
     
    42004199 
    42014200                if (isRenderQueueToBeProcessed(qId)) 
     4201                { 
     4202                        if (leaveTransparentsInQueue) 
     4203                        { 
     4204                                pGroup->clearSolids(); 
     4205                        } 
     4206                        else 
     4207                        { 
    42024208                        pGroup->clear(); 
     4209        } 
     4210                } 
    42034211        } 
    42044212         
Note: See TracChangeset for help on using the changeset viewer.