OGRE  2.2.4
Object-Oriented Graphics Rendering Engine
Ogre::CubemapProbe Class Reference

#include <OgreCubemapProbe.h>

+ Inheritance diagram for Ogre::CubemapProbe:

Public Member Functions

 CubemapProbe (ParallaxCorrectedCubemapBase *creator)
 
 ~CubemapProbe ()
 
void _addReference (void)
 
void _clearCubemap (void)
 
void _prepareForRendering (void)
 
void _removeReference (void)
 
void _updateRender (void)
 
void destroyWorkspace (void)
 
const AabbgetArea (void) const
 
const Vector3getAreaInnerRegion (void) const
 
Aabb getAreaLS (void) const
 
ConstBufferPackedgetConstBufferForManualProbes (void)
 
ParallaxCorrectedCubemapBasegetCreator (void)
 
const SceneNodegetInternalCubemapProbeSceneNode (void) const
 
uint16 getInternalSliceToArrayTexture (void) const
 
TextureGpugetInternalTexture (void) const
 
const Matrix3getInvOrientation (void) const
 
Real getNDF (const Vector3 &posLS) const
 Gets the Normalized Distance Function. More...
 
const Matrix3getOrientation (void) const
 
uint16_t getPriority (void) const
 
const Vector3getProbeCameraPos (void) const
 
const AabbgetProbeShape (void) const
 
bool getStatic (void) const
 
CompositorWorkspacegetWorkspace (void) const
 
void initWorkspace (float cameraNear=0.5f, float cameraFar=500.0f, IdString workspaceDefOverride=IdString(), const CompositorChannelVec &additionalChannels=CompositorChannelVec(), uint8 executionMask=0xFF)
 Initializes the workspace so we can actually render to the cubemap. More...
 
bool isInitialized (void) const
 
void operator delete (void *ptr)
 
void operator delete (void *ptr, void *)
 
void operator delete (void *ptr, const char *, int, const char *)
 
void operator delete[] (void *ptr)
 
void operator delete[] (void *ptr, const char *, int, const char *)
 
void * operator new (size_t sz, const char *file, int line, const char *func)
 operator new, with debug line info More...
 
void * operator new (size_t sz)
 
void * operator new (size_t sz, void *ptr)
 placement operator new More...
 
void * operator new[] (size_t sz, const char *file, int line, const char *func)
 array operator new, with debug line info More...
 
void * operator new[] (size_t sz)
 
void set (const Vector3 &cameraPos, const Aabb &area, const Vector3 &areaInnerRegion, const Matrix3 &orientation, const Aabb &probeShape)
 Sets cubemap probe's parameters. More...
 
void setPriority (uint16 priority)
 When two probes overlap, you may want one probe to have particularly more influence than the others. More...
 
void setStatic (bool isStatic)
 Set to False if it should be updated every frame. More...
 
void setTextureParams (uint32 width, uint32 height, bool useManual=false, PixelFormatGpu pf=PFG_RGBA8_UNORM_SRGB, bool isStatic=true, SampleDescription sampleDesc=SampleDescription())
 

Public Attributes

bool mDirty
 True if we must re-render to update the texture's contents. False when we don't. More...
 
bool mEnabled
 While disabled, this probe won't be updated (even if dirty) and won't be considered for blending (i.e. More...
 
uint32 mMask
 Mask to group probes. More...
 
uint16 mNumIterations
 Number of iterations. More...
 

Friends

class ParallaxCorrectedCubemap
 
class ParallaxCorrectedCubemapAuto
 
class ParallaxCorrectedCubemapBase
 

Constructor & Destructor Documentation

◆ CubemapProbe()

Ogre::CubemapProbe::CubemapProbe ( ParallaxCorrectedCubemapBase creator)

◆ ~CubemapProbe()

Ogre::CubemapProbe::~CubemapProbe ( )

Member Function Documentation

◆ _addReference()

void Ogre::CubemapProbe::_addReference ( void  )

◆ _clearCubemap()

void Ogre::CubemapProbe::_clearCubemap ( void  )

◆ _prepareForRendering()

void Ogre::CubemapProbe::_prepareForRendering ( void  )

◆ _removeReference()

void Ogre::CubemapProbe::_removeReference ( void  )

◆ _updateRender()

void Ogre::CubemapProbe::_updateRender ( void  )

◆ destroyWorkspace()

void Ogre::CubemapProbe::destroyWorkspace ( void  )

◆ getArea()

const Aabb& Ogre::CubemapProbe::getArea ( void  ) const
inline

◆ getAreaInnerRegion()

const Vector3& Ogre::CubemapProbe::getAreaInnerRegion ( void  ) const
inline

◆ getAreaLS()

Aabb Ogre::CubemapProbe::getAreaLS ( void  ) const
inline

◆ getConstBufferForManualProbes()

ConstBufferPacked* Ogre::CubemapProbe::getConstBufferForManualProbes ( void  )
inline

◆ getCreator()

ParallaxCorrectedCubemapBase* Ogre::CubemapProbe::getCreator ( void  )
inline

◆ getInternalCubemapProbeSceneNode()

const SceneNode* Ogre::CubemapProbe::getInternalCubemapProbeSceneNode ( void  ) const

◆ getInternalSliceToArrayTexture()

uint16 Ogre::CubemapProbe::getInternalSliceToArrayTexture ( void  ) const
inline

◆ getInternalTexture()

TextureGpu* Ogre::CubemapProbe::getInternalTexture ( void  ) const
inline

◆ getInvOrientation()

const Matrix3& Ogre::CubemapProbe::getInvOrientation ( void  ) const
inline

◆ getNDF()

Real Ogre::CubemapProbe::getNDF ( const Vector3 posLS) const

Gets the Normalized Distance Function.

Parameters
posLSPosition, in local space (relative to this probe)
Returns
Interpretation: <=0 means we're inside the inner range, or in its border. Range (0; 1) we're between inner and outer range. >=1 means we're outside the object.

◆ getOrientation()

const Matrix3& Ogre::CubemapProbe::getOrientation ( void  ) const
inline

◆ getPriority()

uint16_t Ogre::CubemapProbe::getPriority ( void  ) const

◆ getProbeCameraPos()

const Vector3& Ogre::CubemapProbe::getProbeCameraPos ( void  ) const
inline

◆ getProbeShape()

const Aabb& Ogre::CubemapProbe::getProbeShape ( void  ) const
inline

◆ getStatic()

bool Ogre::CubemapProbe::getStatic ( void  ) const
inline

◆ getWorkspace()

CompositorWorkspace* Ogre::CubemapProbe::getWorkspace ( void  ) const
inline

◆ initWorkspace()

void Ogre::CubemapProbe::initWorkspace ( float  cameraNear = 0.5f,
float  cameraFar = 500.0f,
IdString  workspaceDefOverride = IdString(),
const CompositorChannelVec additionalChannels = CompositorChannelVec(),
uint8  executionMask = 0xFF 
)

Initializes the workspace so we can actually render to the cubemap.

You must call setTextureParams first.

Parameters
mipmapsExecutionMaskWhen ParallaxCorrectedCubemapAuto needs to use DPM via 2D Array (see ParallaxCorrectedCubemapAuto::setUseDpm2DArray), you will most likely NOT want to execute the mipmap pass in the workspace you provide, as the system will automatically generate mipmaps for you in the 2D Array instead. We will be using this value to skip that pass. We'll be calling:
compositorManager->addWorkspace( ..., executionMask = ~mipmapsExecutionMask);
But only when ParallaxCorrectedCubemapAuto::getUseDpm2DArray is true.
workspaceDefOverridePass a null IdString() to use the default workspace definition passed to ParallaxCorrectedCubemap. This value allows you to override it with a different workspace definition.

◆ isInitialized()

bool Ogre::CubemapProbe::isInitialized ( void  ) const

◆ operator delete() [1/3]

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete ( void *  ptr)
inlineinherited

◆ operator delete() [2/3]

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete ( void *  ptr,
void *   
)
inlineinherited

◆ operator delete() [3/3]

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete ( void *  ptr,
const char *  ,
int  ,
const char *   
)
inlineinherited

◆ operator delete[]() [1/2]

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete[] ( void *  ptr)
inlineinherited

◆ operator delete[]() [2/2]

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete[] ( void *  ptr,
const char *  ,
int  ,
const char *   
)
inlineinherited

◆ operator new() [1/3]

template<class Alloc >
void* Ogre::AllocatedObject< Alloc >::operator new ( size_t  sz,
const char *  file,
int  line,
const char *  func 
)
inlineinherited

operator new, with debug line info

◆ operator new() [2/3]

template<class Alloc >
void* Ogre::AllocatedObject< Alloc >::operator new ( size_t  sz)
inlineinherited

◆ operator new() [3/3]

template<class Alloc >
void* Ogre::AllocatedObject< Alloc >::operator new ( size_t  sz,
void *  ptr 
)
inlineinherited

placement operator new

◆ operator new[]() [1/2]

template<class Alloc >
void* Ogre::AllocatedObject< Alloc >::operator new[] ( size_t  sz,
const char *  file,
int  line,
const char *  func 
)
inlineinherited

array operator new, with debug line info

◆ operator new[]() [2/2]

template<class Alloc >
void* Ogre::AllocatedObject< Alloc >::operator new[] ( size_t  sz)
inlineinherited

◆ set()

void Ogre::CubemapProbe::set ( const Vector3 cameraPos,
const Aabb area,
const Vector3 areaInnerRegion,
const Matrix3 orientation,
const Aabb probeShape 
)

Sets cubemap probe's parameters.

Parameters
cameraPosSpecify where the camera will be positioned.
areaWhen the camera enters this area, the probe is collected for blending.
areaInnerRegionA value in range [0; 1]. It indicates a % of the OBB's size that will have smooth interpolation with other probes. When region = 1.0; stepping outside the OBB's results in a lighting "pop". The smaller the value, the smoother the transition, but at the cost of quality & precision while inside the OBB (as results get mixed up with other probes'). The value is per axis.
orientationThe orientation of the AABB that makes it an OBB. This orientation is applied to both probeShape AND area. Skewing and shearing is not tested. May or may not work.
probeShapeNote AABB is actually an OBB (Oriented Bounding Box). See orientation parameter. The OBB should closely match the shape of the environment around it. The better it fits, the more accurate the reflections.

◆ setPriority()

void Ogre::CubemapProbe::setPriority ( uint16  priority)

When two probes overlap, you may want one probe to have particularly more influence than the others.

Use this value to decrease/increase the weight when blending the probes.

Remarks
This value is only useful for Per-Pixel cubemaps
Parameters
priorityA value in range [1; 65535] A higher value means the probe should have a stronger influence over the others.

◆ setStatic()

void Ogre::CubemapProbe::setStatic ( bool  isStatic)

Set to False if it should be updated every frame.

True if only updated when dirty

Remarks
This call is not cheap.

◆ setTextureParams()

void Ogre::CubemapProbe::setTextureParams ( uint32  width,
uint32  height,
bool  useManual = false,
PixelFormatGpu  pf = PFG_RGBA8_UNORM_SRGB,
bool  isStatic = true,
SampleDescription  sampleDesc = SampleDescription() 
)
Remarks
When this CubemapProbe belongs to ParallaxCorrectedCubemapAuto, all parameters except isStatic are ignored! This call is still required.
Parameters
width
height
pf
isStaticSet to False if it should be updated every frame. True if only updated when dirty
sampleDesc
useManualSet to true if you plan on using thie probe for manually rendering, so we keep mipmaps at the probe level. User is responsible for supplying a workspace definition that will generate mipmaps though!

Friends And Related Function Documentation

◆ ParallaxCorrectedCubemap

friend class ParallaxCorrectedCubemap
friend

◆ ParallaxCorrectedCubemapAuto

friend class ParallaxCorrectedCubemapAuto
friend

◆ ParallaxCorrectedCubemapBase

friend class ParallaxCorrectedCubemapBase
friend

Member Data Documentation

◆ mDirty

bool Ogre::CubemapProbe::mDirty

True if we must re-render to update the texture's contents. False when we don't.

◆ mEnabled

bool Ogre::CubemapProbe::mEnabled

While disabled, this probe won't be updated (even if dirty) and won't be considered for blending (i.e.

won't be used at all).

◆ mMask

uint32 Ogre::CubemapProbe::mMask

Mask to group probes.

This probe will only be updated (even if dirty) and blended if mMask & system->mMask is non-zero. Useful for example for probes to be used during the day while other probes to be used during the night; thus you only want one group to be active at the same time. Or if you have per room probes, but during a panoramic shot where many rooms are in sight, and you want a more "global" probe. Defaults to 0xffffffff

◆ mNumIterations

uint16 Ogre::CubemapProbe::mNumIterations

Number of iterations.

The more iterations, the more light bounces and light reflections we can capture (i.e. mirror of mirrors), but it will take longer to rebuild the probe. Default value is 32. For non-static probes, you should set this value to 1 for performance.


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