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

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/VUT/work/ogre_changes/RenderSystems/Direct3D9/include/OgreD3D9HardwareOcclusionQuery.h

    r92 r115  
    3333namespace Ogre { 
    3434 
    35  
    36  
    3735// If you use multiple rendering passes you can test only the first pass and all other passes don't have to be rendered  
    38 // if the first pass resultet has too few pixels visable. 
     36        // if the first pass resultet has too few pixels visible. 
    3937 
    4038// Be sure to render all occlluder first and whats out so the RenderQue don't switch places on  
     
    4644  * 
    4745  * @author Lee Sandberg, email lee@abcmedia.se 
     46        * 
     47        * Updated on 12/7/2004 by Chris McGuirk 
    4848  */ 
    4949class D3D9HardwareOcclusionQuery : public HardwareOcclusionQuery 
     
    7171        void beginOcclusionQuery();      
    7272        void endOcclusionQuery(); 
     73                bool pullOcclusionQuery( unsigned int* NumOfFragments, const HW_OCCLUSIONQUERY flag = HWOCCLUSIONQUERY_FLUSH); 
     74                unsigned int getLastQuerysPixelcount() { return mPixelCount; } 
    7375 
    74 #ifdef GTP_VISIBILITY_MODIFIED_OGRE 
    75         bool pullOcclusionQuery( unsigned int* NumOfFragments, const bool waitForResult, 
    76                                                          const HW_OCCLUSIONQUERY flag  );  
    77         bool pullOcclusionQuery( unsigned int* NumOfFragments, const bool waitForResult ); 
    78 #else 
    79         bool pullOcclusionQuery( unsigned int* NumOfFragments ); 
    80         bool pullOcclusionQuery( unsigned int* NumOfFragments, const HW_OCCLUSIONQUERY flag  );  
    81 #endif // GTP_VISIBILITY_MODIFIED_OGRE 
    82  
    83         unsigned int getLastQuerysPixelcount() { return m_uintPixelCount; } 
    84          
    85         // This functions are optional, it's a simple filter that simply skips some hardware occlusion tests on visable objects only 
    86         // It's easy to use if you don't have to keep track on which objects are visable (can be skipped) and what objects arn't visable.. 
    87         // (None visable objects and object you introduce for the first time have allways to be tested allthough the cheepest possible  
    88         // LOD (Level Of Detail) mesh and material wize).  
     76                // These functions are optional, it's a simple filter that simply skips some hardware occlusion tests on visible objects only 
     77                // It's easy to use if you don't have to keep track of which objects are visible (can be skipped) and what objects arn't visible.. 
     78                // (None visible objects and object you introduce for the first time have always to be tested although the cheapest possible  
     79                // LOD (Level Of Detail) mesh and material-wise).  
    8980 
    9081        /** 
    9182          *    
    92           * Remarks This function allows you to set how often the hardware occlusion really are sent to the driver 
     83                * Remarks This function allows you to set how often the hardware occlusion query is sent to the driver 
    9384          * if you set it to 0 every hw occlusion test is acctually made. If you set it to 1 only the half of your queries are sent  
    94           * for all visable objects. 2 will result in 25% of all queries to acctualy be sent.  
    95           * New and none visable objects will be tested all the time. 
    96           * This functionality is here because this class can keep track on visable and none visable objects for you. 
     85                * 2 will result in 25% of all queries to acctualy be sent.  
     86                * This functionality is here because this class can keep track on visible and none visible objects for you. 
    9787          * Once you you set the SkipRate for any hardware occlusion instance it effects all others. 
    9888          */ 
    9989 
     90                void setSkipRate( int skip ) { mSkipInterval = skip; }                  // Using 2 only 50 % of the tests are actully made and 3 results in only 33% of the tests. So on. 
     91                int      getSkipRate() { return mSkipInterval; }  
    10092 
    101         void setSkipRate( int skip ) { m_Skip = skip; }                 // Using 2 only 50 % of the tests are actually made and 3 results in only 33% of the tests. So on. 
    102         int      getSkipRate() { return m_Skip; }  
    103  
     93#ifdef GTP_VISIBILITY_MODIFIED_OGRE 
     94        bool pullOcclusionQuery( unsigned int* NumOfFragments, const bool waitForResult, const HW_OCCLUSIONQUERY flag = HWOCCLUSIONQUERY_FLUSH );  
     95#endif // GTP_VISIBILITY_MODIFIED_OGRE 
    10496//---------------------------------------------------------------------- 
    10597// Protected members 
     
    10799protected: 
    108100 
    109         bool pullOcclusionQuery( unsigned int* NumOfFragments, const bool waitForResult,  
    110                                                      const DWORD queryFlag ); 
    111  
    112         unsigned int            m_uintPixelCount;                
    113         IDirect3DQuery9*        m_pD3DQuery; 
    114         IDirect3DDevice9*   m_pD3DDevice;       // d3d device 
    115         bool                            m_bOcclusionQuery; 
    116         int                                     m_SkipCounter;          // m_SkipConter =  m_SkipConter % m_Skip; if ( m_SkipConter == 0 && m_uintPixelCount !=0 ) TestHWOcclusion else just return  
    117         static int                      m_Skip;                         // This is shared by all instancies 
    118         bool                            m_bHWOcclusionSupport; 
     101                unsigned int            mPixelCount;             
     102                IDirect3DQuery9*        mpQuery; 
     103                IDirect3DDevice9*   mpDevice; 
     104                int                                     mSkipCounter; 
     105                int                                     mSkipInterval; 
     106                bool                            mHasOcclusionSupport; 
    119107}; 
    120108 
Note: See TracChangeset for help on using the changeset viewer.