- Timestamp:
- 05/30/05 03:20:23 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/work/ogre_changes/RenderSystems/Direct3D9/include/OgreD3D9HardwareOcclusionQuery.h
r92 r115 33 33 namespace Ogre { 34 34 35 36 37 35 // 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. 39 37 40 38 // Be sure to render all occlluder first and whats out so the RenderQue don't switch places on … … 46 44 * 47 45 * @author Lee Sandberg, email lee@abcmedia.se 46 * 47 * Updated on 12/7/2004 by Chris McGuirk 48 48 */ 49 49 class D3D9HardwareOcclusionQuery : public HardwareOcclusionQuery … … 71 71 void beginOcclusionQuery(); 72 72 void endOcclusionQuery(); 73 bool pullOcclusionQuery( unsigned int* NumOfFragments, const HW_OCCLUSIONQUERY flag = HWOCCLUSIONQUERY_FLUSH); 74 unsigned int getLastQuerysPixelcount() { return mPixelCount; } 73 75 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). 89 80 90 81 /** 91 82 * 92 * Remarks This function allows you to set how often the hardware occlusion really aresent to the driver83 * Remarks This function allows you to set how often the hardware occlusion query is sent to the driver 93 84 * 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. 97 87 * Once you you set the SkipRate for any hardware occlusion instance it effects all others. 98 88 */ 99 89 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; } 100 92 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 104 96 //---------------------------------------------------------------------- 105 97 // Protected members … … 107 99 protected: 108 100 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; 119 107 }; 120 108
Note: See TracChangeset
for help on using the changeset viewer.