OpenMW
Public Member Functions | Protected Member Functions | Private Attributes
MWRender::OcclusionQuery Class Reference

Implements hardware occlusion queries on the GPU. More...

#include <occlusionquery.hpp>

List of all members.

Public Member Functions

 OcclusionQuery (OEngine::Render::OgreRenderer *, Ogre::SceneNode *sunNode)
 ~OcclusionQuery ()
bool supported ()
void setActive (bool active)
void update (float duration)
float getSunVisibility () const
void setSunNode (Ogre::SceneNode *node)

Protected Member Functions

virtual void notifyRenderSingleObject (Ogre::Renderable *rend, const Ogre::Pass *pass, const Ogre::AutoParamDataSource *source, const Ogre::LightList *pLightList, bool suppressRenderStateChanges)
virtual void renderQueueEnded (Ogre::uint8 queueGroupId, const Ogre::String &invocation, bool &repeatThisInvocation)

Private Attributes

Ogre::HardwareOcclusionQuery * mSunTotalAreaQuery
Ogre::HardwareOcclusionQuery * mSunVisibleAreaQuery
Ogre::HardwareOcclusionQuery * mActiveQuery
Ogre::Entity * mBBQueryVisible
Ogre::Entity * mBBQueryTotal
Ogre::SceneNode * mSunNode
Ogre::SceneNode * mBBNodeReal
float mSunVisibility
bool mWasVisible
bool mActive
bool mFirstFrame
bool mSupported
bool mDoQuery
OEngine::Render::OgreRenderermRendering

Detailed Description

Implements hardware occlusion queries on the GPU.


Constructor & Destructor Documentation

OcclusionQuery::OcclusionQuery ( OEngine::Render::OgreRenderer ,
Ogre::SceneNode *  sunNode 
)

Member Function Documentation

void OcclusionQuery::notifyRenderSingleObject ( Ogre::Renderable *  rend,
const Ogre::Pass *  pass,
const Ogre::AutoParamDataSource *  source,
const Ogre::LightList *  pLightList,
bool  suppressRenderStateChanges 
) [protected, virtual]
void OcclusionQuery::renderQueueEnded ( Ogre::uint8  queueGroupId,
const Ogre::String &  invocation,
bool &  repeatThisInvocation 
) [protected, virtual]

for every beginOcclusionQuery(), we want a respective pullOcclusionQuery() and vice versa this also means that results can be wrong at other places if we pull, but beginOcclusionQuery() was never called this can happen for example if the object that is tested is outside of the view frustum to prevent this, check if the queries have been performed after everything has been rendered and if not, start them manually

void MWRender::OcclusionQuery::setActive ( bool  active) [inline]

make sure to disable occlusion queries before updating unrelated render targets

Parameters:
active
void OcclusionQuery::setSunNode ( Ogre::SceneNode *  node)
Returns:
true if occlusion queries are supported on the user's hardware
void OcclusionQuery::update ( float  duration)

per-frame update


Member Data Documentation

Ogre::HardwareOcclusionQuery* MWRender::OcclusionQuery::mActiveQuery [private]
Ogre::SceneNode* MWRender::OcclusionQuery::mBBNodeReal [private]
Ogre::Entity* MWRender::OcclusionQuery::mBBQueryTotal [private]
Ogre::SceneNode* MWRender::OcclusionQuery::mSunNode [private]
Ogre::HardwareOcclusionQuery* MWRender::OcclusionQuery::mSunTotalAreaQuery [private]
Ogre::HardwareOcclusionQuery* MWRender::OcclusionQuery::mSunVisibleAreaQuery [private]

The documentation for this class was generated from the following files: