OGRE-Next  2.3
Object-Oriented Graphics Rendering Engine
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, uint32 proxyQueryMask=0)
 
 ~ParallaxCorrectedCubemap ()
 
virtual TextureGpu_acquireTextureSlot (uint16 &outTexSlot)
 Acquires a texture with a given slot. More...
 
virtual void _addManuallyActiveProbe (CubemapProbe *probe)
 
virtual void _copyRenderTargetToCubemap (uint32 cubemapArrayIdx)
 
virtual void _notifyPreparePassHash (const Matrix4 &viewMatrix)
 
void _releaseManualHardwareResources ()
 
virtual void _releaseTextureSlot (TextureGpu *texture, uint32 texSlot)
 
virtual void _removeManuallyActiveProbe (CubemapProbe *probe)
 
void _restoreManualHardwareResources ()
 
void _setIsRendering (bool bIsRendering)
 
void _setProbeRenderInProgress (CubemapProbe *probe)
 
virtual void allWorkspacesBeforeBeginUpdate ()
 Called from CompositorManager2 (not CompositorWorkspace) when we're about to begin updating all the workspaces. More...
 
virtual void allWorkspacesBeginUpdate ()
 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. More...
 
CubemapProbecreateProbe ()
 Adds a cubemap probe. More...
 
void createProxyItems ()
 
virtual void destroyAllProbes ()
 
virtual void destroyProbe (CubemapProbe *probe)
 
void destroyProxyItems ()
 
virtual void eventOccurred (const String &eventName, const NameValuePairList *parameters)
 A rendersystem-specific event occurred. More...
 
virtual void fillConstBufferData (const Matrix4 &viewMatrix, float *RESTRICT_ALIAS passBufferPtr) const
 
virtual TextureGpufindIbl (const TextureGpu *baseParams)
 
virtual TextureGpufindTmpRtt (const TextureGpu *baseParams)
 See mTmpRtt. More...
 
virtual bool frameEnded (const FrameEvent &evt)
 Called just after a frame has been rendered. More...
 
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. More...
 
virtual bool frameStarted (const FrameEvent &evt)
 Called when a frame is about to begin rendering. More...
 
bool getAutomaticMode () const
 
TextureGpugetBindTexture () const
 
const HlmsSamplerblockgetBindTrilinearSamplerblock ()
 
virtual size_t getConstBufferSize ()
 
const CompositorWorkspaceDefgetDefaultWorkspaceDef () const
 
bool getEnabled () const
 
uint32 getIblTargetTextureFlags (PixelFormatGpu pixelFormat) const
 
IdType getId () const
 Get the unique id of this object. More...
 
uint32 getNumCollectedProbes () const
 
const CubemapProbeVecgetProbes () const
 
Item *const * getProxyItems () const
 
uint32 getProxyReservedQueryMask () const
 Returns the query mask you told us you reserved for storing our internal objects. More...
 
uint8 getProxyReservedRenderQueueId () const
 Returns the RenderQueue ID you told us you reserved for storing our internal objects. More...
 
uint32 getProxyReservedVisibilityMask () const
 Returns the visibility mask you told us you reserved for storing our internal objects. More...
 
SceneNode *const * getProxySceneNodes () const
 
SceneManagergetSceneManager () const
 
bool getUseDpm2DArray () const
 
bool isRendering () const
 Inform whether we're currently updating a probe. More...
 
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. More...
 
virtual void passPosExecute (CompositorPass *pass)
 Called after a pass has been executed. More...
 
virtual void passPreExecute (CompositorPass *pass)
 Called when each pass is about to be executed. More...
 
virtual void passSceneAfterFrustumCulling (CompositorPassScene *pass)
 Called after a pass scene has performed frustum caulling but has yet to prepare and execute rendering commands. More...
 
virtual void passSceneAfterShadowMaps (CompositorPassScene *pass)
 Called after a pass scene has rendered shadow casting (it gets called even if there is no shadow node). More...
 
virtual void prepareForClearScene ()
 Destroys the Proxy Items. More...
 
virtual void releaseIbl (const TextureGpu *tmpRtt)
 
virtual void releaseTmpRtt (const TextureGpu *tmpRtt)
 
virtual void restoreFromClearScene ()
 
void setEnabled (bool bEnabled, uint32 maxWidth, uint32 maxHeight, PixelFormatGpu pixelFormat)
 Enables/disables this ParallaxCorrectedCubemap system. More...
 
void setUpdatedTrackedDataFromCamera (Camera *trackedCamera)
 Will update both mTrackedPosition & mTrackedViewProjMatrix with appropiate settings every time it's called. More...
 
void updateAllDirtyProbes ()
 By default the probes will be constructed when the user enters its vecinity. More...
 
virtual void workspacePosUpdate (CompositorWorkspace *workspace)
 Called after all nodes has been updated. More...
 
virtual void workspacePreUpdate (CompositorWorkspace *workspace)
 Called before all nodes are going to be updated. More...
 

Static Public Member Functions

static void fillConstBufferData (const CubemapProbe &probe, const Matrix4 &viewMatrix, const Matrix3 &invViewMat3, float *RESTRICT_ALIAS passBufferPtr)
 
static size_t getConstBufferSizeStatic ()
 
static uint8 getIblNumMipmaps (uint32 width, uint32 height)
 

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. More...
 
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. More...
 

Detailed Description

Constructor & Destructor Documentation

◆ ParallaxCorrectedCubemap()

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

◆ ~ParallaxCorrectedCubemap()

Ogre::ParallaxCorrectedCubemap::~ParallaxCorrectedCubemap ( )

Member Function Documentation

◆ _acquireTextureSlot()

virtual TextureGpu* Ogre::ParallaxCorrectedCubemapBase::_acquireTextureSlot ( uint16 outTexSlot)
virtualinherited

Acquires a texture with a given slot.

Parameters
outTexSlot[out] Texture slot. Value is left untouched if return value is nullptr
Returns
Texture. Can be nullptr if ran out of slots.

Reimplemented in Ogre::ParallaxCorrectedCubemapAuto.

◆ _addManuallyActiveProbe()

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

◆ _copyRenderTargetToCubemap()

virtual void Ogre::ParallaxCorrectedCubemapBase::_copyRenderTargetToCubemap ( uint32  cubemapArrayIdx)
virtualinherited

◆ _notifyPreparePassHash()

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

◆ _releaseManualHardwareResources()

void Ogre::ParallaxCorrectedCubemap::_releaseManualHardwareResources ( )
virtual

◆ _releaseTextureSlot()

virtual void Ogre::ParallaxCorrectedCubemapBase::_releaseTextureSlot ( TextureGpu texture,
uint32  texSlot 
)
virtualinherited

◆ _removeManuallyActiveProbe()

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

◆ _restoreManualHardwareResources()

void Ogre::ParallaxCorrectedCubemap::_restoreManualHardwareResources ( )
virtual

◆ _setIsRendering()

void Ogre::ParallaxCorrectedCubemapBase::_setIsRendering ( bool  bIsRendering)
inlineinherited

◆ _setProbeRenderInProgress()

void Ogre::ParallaxCorrectedCubemapBase::_setProbeRenderInProgress ( CubemapProbe probe)
inlineinherited

◆ allWorkspacesBeforeBeginUpdate()

virtual void Ogre::ParallaxCorrectedCubemap::allWorkspacesBeforeBeginUpdate ( )
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 ( )
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::ParallaxCorrectedCubemapBase::createProbe ( )
inherited

Adds a cubemap probe.

◆ createProxyItems()

void Ogre::ParallaxCorrectedCubemap::createProxyItems ( )

◆ destroyAllProbes()

virtual void Ogre::ParallaxCorrectedCubemap::destroyAllProbes ( )
virtual

◆ destroyProbe()

virtual void Ogre::ParallaxCorrectedCubemapBase::destroyProbe ( CubemapProbe probe)
virtualinherited

◆ destroyProxyItems()

void Ogre::ParallaxCorrectedCubemap::destroyProxyItems ( )

◆ eventOccurred()

virtual void Ogre::ParallaxCorrectedCubemapBase::eventOccurred ( const String eventName,
const NameValuePairList parameters 
)
virtualinherited

A rendersystem-specific event occurred.

Parameters
eventNameThe name of the event which has occurred
parametersA list of parameters that may belong to this event, may be null if there are no parameters

Implements Ogre::RenderSystem::Listener.

◆ fillConstBufferData() [1/2]

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

◆ fillConstBufferData() [2/2]

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

◆ findIbl()

virtual TextureGpu* Ogre::ParallaxCorrectedCubemap::findIbl ( const TextureGpu baseParams)
virtual

◆ findTmpRtt()

virtual TextureGpu* Ogre::ParallaxCorrectedCubemap::findTmpRtt ( const TextureGpu baseParams)
virtual

See mTmpRtt.

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

Reimplemented from Ogre::ParallaxCorrectedCubemapBase.

◆ 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.

◆ getAutomaticMode()

bool Ogre::ParallaxCorrectedCubemapBase::getAutomaticMode ( ) const
inlineinherited

◆ getBindTexture()

TextureGpu* Ogre::ParallaxCorrectedCubemapBase::getBindTexture ( ) const
inlineinherited

◆ getBindTrilinearSamplerblock()

const HlmsSamplerblock* Ogre::ParallaxCorrectedCubemapBase::getBindTrilinearSamplerblock ( )
inlineinherited

◆ getConstBufferSize()

virtual size_t Ogre::ParallaxCorrectedCubemap::getConstBufferSize ( )
virtual

◆ getConstBufferSizeStatic()

static size_t Ogre::ParallaxCorrectedCubemap::getConstBufferSizeStatic ( )
static

◆ getDefaultWorkspaceDef()

const CompositorWorkspaceDef* Ogre::ParallaxCorrectedCubemapBase::getDefaultWorkspaceDef ( ) const
inherited

◆ getEnabled()

bool Ogre::ParallaxCorrectedCubemap::getEnabled ( ) const

◆ getIblNumMipmaps()

static uint8 Ogre::ParallaxCorrectedCubemapBase::getIblNumMipmaps ( uint32  width,
uint32  height 
)
staticinherited

◆ getIblTargetTextureFlags()

uint32 Ogre::ParallaxCorrectedCubemapBase::getIblTargetTextureFlags ( PixelFormatGpu  pixelFormat) const
inherited

◆ getId()

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

Get the unique id of this object.

◆ getNumCollectedProbes()

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

◆ getProbes()

const CubemapProbeVec& Ogre::ParallaxCorrectedCubemapBase::getProbes ( ) const
inlineinherited

◆ getProxyItems()

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

◆ getProxyReservedQueryMask()

uint32 Ogre::ParallaxCorrectedCubemap::getProxyReservedQueryMask ( ) const
inline

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

◆ getProxyReservedRenderQueueId()

uint8 Ogre::ParallaxCorrectedCubemap::getProxyReservedRenderQueueId ( ) 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 ( ) 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 ( ) const
inline

◆ getSceneManager()

SceneManager* Ogre::ParallaxCorrectedCubemapBase::getSceneManager ( ) const
inherited

◆ getUseDpm2DArray()

bool Ogre::ParallaxCorrectedCubemapBase::getUseDpm2DArray ( ) const
inlineinherited

◆ isRendering()

bool Ogre::ParallaxCorrectedCubemapBase::isRendering ( ) const
inlineinherited

Inform whether we're currently updating a probe.

Some Hlms / PCC combinations should not perform PCC while rendering, either because the RenderTarget is the same as the cubemap texture, or because other glitches may occur

◆ 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::ParallaxCorrectedCubemapBase.

◆ passSceneAfterFrustumCulling()

virtual void Ogre::CompositorWorkspaceListener::passSceneAfterFrustumCulling ( CompositorPassScene pass)
inlinevirtualinherited

Called after a pass scene has performed frustum caulling but has yet to prepare and execute rendering commands.

Gets called after passSceneAfterFrustumCulling and before passPosExecute

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

◆ passSceneAfterShadowMaps()

virtual void Ogre::CompositorWorkspaceListener::passSceneAfterShadowMaps ( CompositorPassScene pass)
inlinevirtualinherited

Called after a pass scene has rendered shadow casting (it gets called even if there is no shadow node).

Gets called after passPreExecute and before passSceneAfterFrustumCulling

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

◆ prepareForClearScene()

virtual void Ogre::ParallaxCorrectedCubemap::prepareForClearScene ( )
virtual

Destroys the Proxy Items.

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

Reimplemented from Ogre::ParallaxCorrectedCubemapBase.

◆ releaseIbl()

virtual void Ogre::ParallaxCorrectedCubemap::releaseIbl ( const TextureGpu tmpRtt)
virtual

◆ releaseTmpRtt()

virtual void Ogre::ParallaxCorrectedCubemap::releaseTmpRtt ( const TextureGpu tmpRtt)
virtual

◆ restoreFromClearScene()

virtual void Ogre::ParallaxCorrectedCubemap::restoreFromClearScene ( )
virtual

◆ setEnabled()

void Ogre::ParallaxCorrectedCubemap::setEnabled ( bool  bEnabled,
uint32  maxWidth,
uint32  maxHeight,
PixelFormatGpu  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.
pixelFormatPixelFormatGpu 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 ( )
virtual

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)

Implements Ogre::ParallaxCorrectedCubemapBase.

◆ workspacePosUpdate()

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

Called after all nodes has been updated.

◆ 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::ParallaxCorrectedCubemapBase::mMask
inherited

◆ mPaused

bool Ogre::ParallaxCorrectedCubemapBase::mPaused
inherited

◆ 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: