OpenMW
|
Implements hardware occlusion queries on the GPU. More...
#include <occlusionquery.hpp>
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::OgreRenderer * | mRendering |
Implements hardware occlusion queries on the GPU.
OcclusionQuery::OcclusionQuery | ( | OEngine::Render::OgreRenderer * | , |
Ogre::SceneNode * | sunNode | ||
) |
float MWRender::OcclusionQuery::getSunVisibility | ( | ) | const [inline] |
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
active |
void OcclusionQuery::setSunNode | ( | Ogre::SceneNode * | node | ) |
bool OcclusionQuery::supported | ( | ) |
void OcclusionQuery::update | ( | float | duration | ) |
per-frame update
bool MWRender::OcclusionQuery::mActive [private] |
Ogre::HardwareOcclusionQuery* MWRender::OcclusionQuery::mActiveQuery [private] |
Ogre::SceneNode* MWRender::OcclusionQuery::mBBNodeReal [private] |
Ogre::Entity* MWRender::OcclusionQuery::mBBQueryTotal [private] |
Ogre::Entity* MWRender::OcclusionQuery::mBBQueryVisible [private] |
bool MWRender::OcclusionQuery::mDoQuery [private] |
bool MWRender::OcclusionQuery::mFirstFrame [private] |
Ogre::SceneNode* MWRender::OcclusionQuery::mSunNode [private] |
Ogre::HardwareOcclusionQuery* MWRender::OcclusionQuery::mSunTotalAreaQuery [private] |
float MWRender::OcclusionQuery::mSunVisibility [private] |
Ogre::HardwareOcclusionQuery* MWRender::OcclusionQuery::mSunVisibleAreaQuery [private] |
bool MWRender::OcclusionQuery::mSupported [private] |
bool MWRender::OcclusionQuery::mWasVisible [private] |