OGRE 2.1
Object-Oriented Graphics Rendering Engine
Loading...
Searching...
No Matches
Ogre::ParallaxCorrectedCubemap Class Reference

#include <OgreParallaxCorrectedCubemap.h>

+ Inheritance diagram for Ogre::ParallaxCorrectedCubemap:

Public Member Functions

 ParallaxCorrectedCubemap (IdType id, Root *root, SceneManager *sceneManager, const CompositorWorkspaceDef *probeWorkspaceDef, uint8 reservedRqId, uint32 proxyVisibilityMask)
 
 ~ParallaxCorrectedCubemap ()
 
void _addManuallyActiveProbe (CubemapProbe *probe)
 
void _notifyPreparePassHash (const Matrix4 &viewMatrix)
 
void _removeManuallyActiveProbe (CubemapProbe *probe)
 
virtual void allWorkspacesBeforeBeginUpdate (void)
 Called from CompositorManager2 (not CompositorWorkspace) when we're about to begin updating all the workspaces.
 
virtual void allWorkspacesBeginUpdate (void)
 Called from CompositorManager2 (not CompositorWorkspace) when we're about to update all the workspaces (it's safe to update your own workspaces without calling _beginUpdate and _endUpdate) Warning: Don't add/remove listeners to CompositorManager2 inside this function.
 
CubemapProbecreateProbe (void)
 Adds a cubemap probe.
 
void createProxyItems (void)
 Creates the Proxy Items.
 
void destroyAllProbes (void)
 
void destroyProbe (CubemapProbe *probe)
 
void destroyProxyItems (void)
 Destroys the Proxy Items.
 
void fillConstBufferData (const CubemapProbe &probe, const Matrix4 &viewMatrix, const Matrix3 &invViewMat3, float *RESTRICT_ALIAS passBufferPtr) const
 
void fillConstBufferData (const Matrix4 &viewMatrix, float *RESTRICT_ALIAS passBufferPtr) const
 
TexturePtr findTmpRtt (const TexturePtr &baseParams)
 See mTmpRtt.
 
virtual bool frameEnded (const FrameEvent &evt)
 Called just after a frame has been rendered.
 
virtual bool frameRenderingQueued (const FrameEvent &evt)
 Called after all render targets have had their rendering commands issued, but before render windows have been asked to flip their buffers over.
 
virtual bool frameStarted (const FrameEvent &evt)
 Called when a frame is about to begin rendering.
 
TexturePtr getBlendCubemap (void) const
 
const HlmsSamplerblockgetBlendCubemapTrilinearSamplerblock (void)
 
const CompositorWorkspaceDefgetDefaultWorkspaceDef (void) const
 
bool getEnabled (void) const
 
IdType getId () const
 Get the unique id of this object.
 
uint32 getNumCollectedProbes (void) const
 
const CubemapProbeVecgetProbes (void) const
 
Item *constgetProxyItems (void) const
 
uint8 getProxyReservedRenderQueueId (void) const
 Returns the RenderQueue ID you told us you reserved for storing our internal objects.
 
uint32 getProxyReservedVisibilityMask (void) const
 Returns the visibility mask you told us you reserved for storing our internal objects.
 
SceneNode *constgetProxySceneNodes (void) const
 
SceneManagergetSceneManager (void) const
 
bool operator() (const IdObject &left, const IdObject &right)
 
bool operator() (const IdObject *left, const IdObject *right)
 
virtual void passEarlyPreExecute (CompositorPass *pass)
 Called early on in pass' execution.
 
virtual void passPosExecute (CompositorPass *pass)
 Called after a pass has been executed.
 
virtual void passPreExecute (CompositorPass *pass)
 Called when each pass is about to be executed.
 
void releaseTmpRtt (const TexturePtr &tmpRtt)
 
void setEnabled (bool bEnabled, uint32 maxWidth, uint32 maxHeight, PixelFormat pixelFormat)
 Enables/disables this ParallaxCorrectedCubemap system.
 
void setUpdatedTrackedDataFromCamera (Camera *trackedCamera)
 Will update both mTrackedPosition & mTrackedViewProjMatrix with appropiate settings every time it's called.
 
void updateAllDirtyProbes (void)
 By default the probes will be constructed when the user enters its vecinity.
 
virtual void workspacePreUpdate (CompositorWorkspace *workspace)
 Called before all nodes are going to be updated.
 

Static Public Member Functions

static size_t getConstBufferSize (void)
 

Public Attributes

uint32 mMask
 
bool mPaused
 
Vector3 mTrackedPosition
 This variable should be updated every frame and often represents the camera position, but it can also be used set to other things like the player's character position.
 
Matrix4 mTrackedViewProjMatrix
 When mTrackedPosition is not inside any probe, we'll use the view-projection matrix to select the closest probe based on which one has approximately the largest volume shown on camera.
 

Detailed Description

Constructor & Destructor Documentation

◆ ParallaxCorrectedCubemap()

Ogre::ParallaxCorrectedCubemap::ParallaxCorrectedCubemap ( IdType  id,
Root root,
SceneManager sceneManager,
const CompositorWorkspaceDef probeWorkspaceDef,
uint8  reservedRqId,
uint32  proxyVisibilityMask 
)

◆ ~ParallaxCorrectedCubemap()

Ogre::ParallaxCorrectedCubemap::~ParallaxCorrectedCubemap ( )

Member Function Documentation

◆ _addManuallyActiveProbe()

void Ogre::ParallaxCorrectedCubemap::_addManuallyActiveProbe ( CubemapProbe probe)

◆ _notifyPreparePassHash()

void Ogre::ParallaxCorrectedCubemap::_notifyPreparePassHash ( const Matrix4 viewMatrix)

◆ _removeManuallyActiveProbe()

void Ogre::ParallaxCorrectedCubemap::_removeManuallyActiveProbe ( CubemapProbe probe)

◆ allWorkspacesBeforeBeginUpdate()

virtual void Ogre::ParallaxCorrectedCubemap::allWorkspacesBeforeBeginUpdate ( void  )
virtual

Called from CompositorManager2 (not CompositorWorkspace) when we're about to begin updating all the workspaces.

You'll have to manage the RenderSystem and SceneManager to call the adequate begin/end calls Warning: Don't add/remove listeners to CompositorManager2 inside this function.

Reimplemented from Ogre::CompositorWorkspaceListener.

◆ allWorkspacesBeginUpdate()

virtual void Ogre::ParallaxCorrectedCubemap::allWorkspacesBeginUpdate ( void  )
virtual

Called from CompositorManager2 (not CompositorWorkspace) when we're about to update all the workspaces (it's safe to update your own workspaces without calling _beginUpdate and _endUpdate) Warning: Don't add/remove listeners to CompositorManager2 inside this function.

Reimplemented from Ogre::CompositorWorkspaceListener.

◆ createProbe()

CubemapProbe * Ogre::ParallaxCorrectedCubemap::createProbe ( void  )

Adds a cubemap probe.

◆ createProxyItems()

void Ogre::ParallaxCorrectedCubemap::createProxyItems ( void  )

Creates the Proxy Items.

Useful if you need to call sceneManager->clearScene(); See destroyProxyItems.

◆ destroyAllProbes()

void Ogre::ParallaxCorrectedCubemap::destroyAllProbes ( void  )

◆ destroyProbe()

void Ogre::ParallaxCorrectedCubemap::destroyProbe ( CubemapProbe probe)

◆ destroyProxyItems()

void Ogre::ParallaxCorrectedCubemap::destroyProxyItems ( void  )

Destroys the Proxy Items.

Useful if you need to call sceneManager->clearScene(); The you MUST call this function before. i.e. pcc->destroyProxyItems(); sceneManager->clearScene(); pcc->createProxyItems(); Updating ParallaxCorrectedCubemap without calling createProxyItems again will result in a crash.

◆ fillConstBufferData() [1/2]

void Ogre::ParallaxCorrectedCubemap::fillConstBufferData ( const CubemapProbe probe,
const Matrix4 viewMatrix,
const Matrix3 invViewMat3,
float *RESTRICT_ALIAS  passBufferPtr 
) const

◆ fillConstBufferData() [2/2]

void Ogre::ParallaxCorrectedCubemap::fillConstBufferData ( const Matrix4 viewMatrix,
float *RESTRICT_ALIAS  passBufferPtr 
) const

◆ findTmpRtt()

TexturePtr Ogre::ParallaxCorrectedCubemap::findTmpRtt ( const TexturePtr baseParams)

See mTmpRtt.

Finds an RTT that is compatible to copy to baseParams. Creates one if none found.

◆ frameEnded()

virtual bool Ogre::FrameListener::frameEnded ( const FrameEvent evt)
inlinevirtualinherited

Called just after a frame has been rendered.

Remarks
This event happens after all render targets have been fully updated and the buffers switched.
Returns
True to continue with the next frame, false to drop out of the rendering loop.

Reimplemented in Ogre::FrameTimeControllerValue.

◆ frameRenderingQueued()

virtual bool Ogre::FrameListener::frameRenderingQueued ( const FrameEvent evt)
inlinevirtualinherited

Called after all render targets have had their rendering commands issued, but before render windows have been asked to flip their buffers over.

Remarks
The usefulness of this event comes from the fact that rendering commands are queued for the GPU to process. These can take a little while to finish, and so while that is happening the CPU can be doing useful things. Once the request to 'flip buffers' happens, the thread requesting it will block until the GPU is ready, which can waste CPU cycles. Therefore, it is often a good idea to use this callback to perform per-frame processing. Of course because the frame's rendering commands have already been issued, any changes you make will only take effect from the next frame, but in most cases that's not noticeable.
Returns
True to continue rendering, false to drop out of the rendering loop.

◆ frameStarted()

virtual bool Ogre::ParallaxCorrectedCubemap::frameStarted ( const FrameEvent evt)
virtual

Called when a frame is about to begin rendering.

Remarks
This event happens before any render targets have begun updating.
Returns
True to go ahead, false to abort rendering and drop out of the rendering loop.

Reimplemented from Ogre::FrameListener.

◆ getBlendCubemap()

TexturePtr Ogre::ParallaxCorrectedCubemap::getBlendCubemap ( void  ) const
inline

◆ getBlendCubemapTrilinearSamplerblock()

const HlmsSamplerblock * Ogre::ParallaxCorrectedCubemap::getBlendCubemapTrilinearSamplerblock ( void  )
inline

◆ getConstBufferSize()

static size_t Ogre::ParallaxCorrectedCubemap::getConstBufferSize ( void  )
static

◆ getDefaultWorkspaceDef()

const CompositorWorkspaceDef * Ogre::ParallaxCorrectedCubemap::getDefaultWorkspaceDef ( void  ) const

◆ getEnabled()

bool Ogre::ParallaxCorrectedCubemap::getEnabled ( void  ) const

◆ getId()

IdType Ogre::IdObject::getId ( ) const
inlineinherited

Get the unique id of this object.

◆ getNumCollectedProbes()

uint32 Ogre::ParallaxCorrectedCubemap::getNumCollectedProbes ( void  ) const
inline

◆ getProbes()

const CubemapProbeVec & Ogre::ParallaxCorrectedCubemap::getProbes ( void  ) const
inline

◆ getProxyItems()

Item *const * Ogre::ParallaxCorrectedCubemap::getProxyItems ( void  ) const
inline

◆ getProxyReservedRenderQueueId()

uint8 Ogre::ParallaxCorrectedCubemap::getProxyReservedRenderQueueId ( void  ) const
inline

Returns the RenderQueue ID you told us you reserved for storing our internal objects.

Do not attempt to render the objects that match in that Rq ID & visibility mask.

◆ getProxyReservedVisibilityMask()

uint32 Ogre::ParallaxCorrectedCubemap::getProxyReservedVisibilityMask ( void  ) const
inline

Returns the visibility mask you told us you reserved for storing our internal objects.

Do not attempt to render the objects that match in that Rq ID & visibility mask.

◆ getProxySceneNodes()

SceneNode *const * Ogre::ParallaxCorrectedCubemap::getProxySceneNodes ( void  ) const
inline

◆ getSceneManager()

SceneManager * Ogre::ParallaxCorrectedCubemap::getSceneManager ( void  ) const

◆ operator()() [1/2]

bool Ogre::IdObject::operator() ( const IdObject left,
const IdObject right 
)
inlineinherited

◆ operator()() [2/2]

bool Ogre::IdObject::operator() ( const IdObject left,
const IdObject right 
)
inlineinherited

◆ passEarlyPreExecute()

virtual void Ogre::CompositorWorkspaceListener::passEarlyPreExecute ( CompositorPass pass)
inlinevirtualinherited

Called early on in pass' execution.

Happens before passPreExecute, before the pass has set anything. Warning: calling pass->execute can result in recursive calls.

◆ passPosExecute()

virtual void Ogre::CompositorWorkspaceListener::passPosExecute ( CompositorPass pass)
inlinevirtualinherited

Called after a pass has been executed.

Warning: calling pass->execute can result in recursive calls.

◆ passPreExecute()

virtual void Ogre::ParallaxCorrectedCubemap::passPreExecute ( CompositorPass pass)
virtual

Called when each pass is about to be executed.

Warning: calling pass->execute can result in recursive calls.

Reimplemented from Ogre::CompositorWorkspaceListener.

◆ releaseTmpRtt()

void Ogre::ParallaxCorrectedCubemap::releaseTmpRtt ( const TexturePtr tmpRtt)

◆ setEnabled()

void Ogre::ParallaxCorrectedCubemap::setEnabled ( bool  bEnabled,
uint32  maxWidth,
uint32  maxHeight,
PixelFormat  pixelFormat 
)

Enables/disables this ParallaxCorrectedCubemap system.

It will (de)allocate some resources, thus it may cause stalls. If you need to temporarily pause the system (or toggle at high frequency) use mPaused instead (it's a public variable).

Parameters
bEnabledTrue to enable. False to disable. When false, the rest of the arguments are ignored.
maxWidthThis system allows probes to be of different resolution. The final merge must have a particular resolution though. This setting defines that value. If there's a probe that has a bigger resolution than this, then you'll be wasting memory and power on that probe. In other words, no probe should have a higher res than this setting.
maxHeightSee maxHeight.
pixelFormatPixelFormat of the final blended/merged cubemap.

◆ setUpdatedTrackedDataFromCamera()

void Ogre::ParallaxCorrectedCubemap::setUpdatedTrackedDataFromCamera ( Camera trackedCamera)

Will update both mTrackedPosition & mTrackedViewProjMatrix with appropiate settings every time it's called.

Must be called every time the camera changes.

Remarks
You don't have to use a camera, which is why mTrackedPosition & mTrackedViewProjMatrix are public variables. Sometimes you want something else to be used as reference for probe blending (e.g. character's position instead of the camera). This is up to you.
Parameters
trackedCameraCamera whose settings to use as reference. We will not keep a reference to this pointer.

◆ updateAllDirtyProbes()

void Ogre::ParallaxCorrectedCubemap::updateAllDirtyProbes ( void  )

By default the probes will be constructed when the user enters its vecinity.

This can cause noticeable stalls. Use this function to regenerate them all at once (i.e. at loading time)

◆ workspacePreUpdate()

virtual void Ogre::CompositorWorkspaceListener::workspacePreUpdate ( CompositorWorkspace workspace)
inlinevirtualinherited

Called before all nodes are going to be updated.

Use this place to update your own, manually updated Workspaces without having to call @CompositorWorkspace::_beginUpdate( forceBeginFrame=true )

Member Data Documentation

◆ mMask

uint32 Ogre::ParallaxCorrectedCubemap::mMask

◆ mPaused

bool Ogre::ParallaxCorrectedCubemap::mPaused

◆ mTrackedPosition

Vector3 Ogre::ParallaxCorrectedCubemap::mTrackedPosition

This variable should be updated every frame and often represents the camera position, but it can also be used set to other things like the player's character position.

◆ mTrackedViewProjMatrix

Matrix4 Ogre::ParallaxCorrectedCubemap::mTrackedViewProjMatrix

When mTrackedPosition is not inside any probe, we'll use the view-projection matrix to select the closest probe based on which one has approximately the largest volume shown on camera.

See setUpdatedTrackedDataFromCamera if you don't know how to set this


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