![]() |
OGRE-Next
4.0.0unstable
Object-Oriented Graphics Rendering Engine
|
#include <OgreParallaxCorrectedCubemap.h>
Public Member Functions | |
ParallaxCorrectedCubemap (IdType id, Root *root, SceneManager *sceneManager, const CompositorWorkspaceDef *probeWorkspaceDef, uint8 reservedRqId, uint32 proxyVisibilityMask, uint32 proxyQueryMask=0) | |
~ParallaxCorrectedCubemap () override | |
void | _addManuallyActiveProbe (CubemapProbe *probe) override |
void | _notifyPreparePassHash (const Matrix4 &viewMatrix) override |
void | _releaseManualHardwareResources () override |
void | _removeManuallyActiveProbe (CubemapProbe *probe) override |
void | _restoreManualHardwareResources () override |
void | allWorkspacesBeforeBeginUpdate () override |
Called from CompositorManager2 (not CompositorWorkspace) when we're about to begin updating all the workspaces. More... | |
void | allWorkspacesBeginUpdate () override |
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... | |
void | createProxyItems () |
void | destroyAllProbes () override |
void | destroyProxyItems () |
void | fillConstBufferData (const Matrix4 &viewMatrix, float *RESTRICT_ALIAS passBufferPtr) const override |
TextureGpu * | findIbl (const TextureGpu *baseParams) override |
TextureGpu * | findTmpRtt (const TextureGpu *baseParams) override |
See mTmpRtt. More... | |
bool | frameStarted (const FrameEvent &evt) override |
Called when a frame is about to begin rendering. More... | |
size_t | getConstBufferSize () override |
bool | getEnabled () const |
uint32 | getNumCollectedProbes () 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 |
void | passPreExecute (CompositorPass *pass) override |
Called when each pass is about to be executed. More... | |
void | prepareForClearScene () override |
Destroys the Proxy Items. More... | |
void | releaseIbl (const TextureGpu *tmpRtt) override |
void | releaseTmpRtt (const TextureGpu *tmpRtt) override |
void | restoreFromClearScene () override |
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 () override |
By default the probes will be constructed when the user enters its vecinity. More... | |
![]() | |
ParallaxCorrectedCubemapBase (IdType id, Root *root, SceneManager *sceneManager, const CompositorWorkspaceDef *probeWorkspaceDef, bool automaticMode) | |
~ParallaxCorrectedCubemapBase () override | |
virtual TextureGpu * | _acquireTextureSlot (uint16 &outTexSlot) |
Acquires a texture with a given slot. More... | |
virtual void | _copyRenderTargetToCubemap (uint32 cubemapArrayIdx) |
virtual void | _releaseTextureSlot (TextureGpu *texture, uint32 texSlot) |
void | _setIsRendering (bool bIsRendering) |
void | _setProbeRenderInProgress (CubemapProbe *probe) |
CubemapProbe * | createProbe () |
Adds a cubemap probe. More... | |
virtual void | destroyProbe (CubemapProbe *probe) |
void | eventOccurred (const String &eventName, const NameValuePairList *parameters) override |
A rendersystem-specific event occurred. More... | |
bool | getAutomaticMode () const |
TextureGpu * | getBindTexture () const |
const HlmsSamplerblock * | getBindTrilinearSamplerblock () |
const CompositorWorkspaceDef * | getDefaultWorkspaceDef () const |
uint32 | getIblTargetTextureFlags (PixelFormatGpu pixelFormat) const |
const CubemapProbeVec & | getProbes () const |
SceneManager * | getSceneManager () const |
bool | getUseDpm2DArray () const |
bool | isRendering () const |
Inform whether we're currently updating a probe. More... | |
void | passPreExecute (CompositorPass *pass) override |
Called when each pass is about to be executed. More... | |
![]() | |
IdObject (IdType id) | |
We don't call generateNewId() here, to prevent objects in the stack (i.e. More... | |
IdType | getId () const |
Get the unique id of this object. More... | |
bool | operator() (const IdObject &left, const IdObject &right) |
bool | operator() (const IdObject *left, const IdObject *right) |
![]() | |
Listener () | |
virtual | ~Listener () |
![]() | |
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 | 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 | 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... | |
![]() | |
virtual | ~FrameListener () |
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... | |
Static Public Member Functions | |
static size_t | getConstBufferSizeStatic () |
![]() | |
static void | fillConstBufferData (const CubemapProbe &probe, const Matrix4 &viewMatrix, const Matrix3 &invViewMat3, float *RESTRICT_ALIAS passBufferPtr) |
static uint8 | getIblNumMipmaps (uint32 width, uint32 height) |
Public Attributes | |
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... | |
![]() | |
uint32 | mMask |
bool | mPaused |
Ogre::ParallaxCorrectedCubemap::ParallaxCorrectedCubemap | ( | IdType | id, |
Root * | root, | ||
SceneManager * | sceneManager, | ||
const CompositorWorkspaceDef * | probeWorkspaceDef, | ||
uint8 | reservedRqId, | ||
uint32 | proxyVisibilityMask, | ||
uint32 | proxyQueryMask = 0 |
||
) |
|
override |
|
overridevirtual |
Reimplemented from Ogre::ParallaxCorrectedCubemapBase.
|
overridevirtual |
Reimplemented from Ogre::ParallaxCorrectedCubemapBase.
|
overridevirtual |
Reimplemented from Ogre::ParallaxCorrectedCubemapBase.
|
overridevirtual |
Reimplemented from Ogre::ParallaxCorrectedCubemapBase.
|
overridevirtual |
Reimplemented from Ogre::ParallaxCorrectedCubemapBase.
|
overridevirtual |
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.
|
overridevirtual |
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.
void Ogre::ParallaxCorrectedCubemap::createProxyItems | ( | ) |
|
overridevirtual |
Reimplemented from Ogre::ParallaxCorrectedCubemapBase.
void Ogre::ParallaxCorrectedCubemap::destroyProxyItems | ( | ) |
|
overridevirtual |
Reimplemented from Ogre::ParallaxCorrectedCubemapBase.
|
overridevirtual |
Reimplemented from Ogre::ParallaxCorrectedCubemapBase.
|
overridevirtual |
See mTmpRtt.
Finds an RTT that is compatible to copy to baseParams. Creates one if none found.
Reimplemented from Ogre::ParallaxCorrectedCubemapBase.
|
overridevirtual |
Called when a frame is about to begin rendering.
Reimplemented from Ogre::FrameListener.
|
overridevirtual |
Reimplemented from Ogre::ParallaxCorrectedCubemapBase.
|
static |
bool Ogre::ParallaxCorrectedCubemap::getEnabled | ( | ) | const |
|
inline |
|
inline |
|
inline |
Returns the query mask you told us you reserved for storing our internal objects.
|
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.
|
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.
|
inline |
|
overridevirtual |
Called when each pass is about to be executed.
Warning: calling pass->execute can result in recursive calls.
Reimplemented from Ogre::CompositorWorkspaceListener.
|
overridevirtual |
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.
|
overridevirtual |
Reimplemented from Ogre::ParallaxCorrectedCubemapBase.
|
overridevirtual |
Reimplemented from Ogre::ParallaxCorrectedCubemapBase.
|
overridevirtual |
Reimplemented from Ogre::ParallaxCorrectedCubemapBase.
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).
bEnabled | True to enable. False to disable. When false, the rest of the arguments are ignored. |
maxWidth | This 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. |
maxHeight | See maxHeight. |
pixelFormat | PixelFormatGpu of the final blended/merged cubemap. |
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.
trackedCamera | Camera whose settings to use as reference. We will not keep a reference to this pointer. |
|
overridevirtual |
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.
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.
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