![]() |
OGRE-Next
2.3
Object-Oriented Graphics Rendering Engine
|
Shadow Nodes are special nodes (not to be confused with. More...
#include <OgreCompositorShadowNode.h>
Public Types | |
typedef vector< bool >::type | LightsBitSet |
Public Member Functions | |
CompositorShadowNode (IdType id, const CompositorShadowNodeDef *definition, CompositorWorkspace *workspace, RenderSystem *renderSys, TextureGpu *finalTarget) | |
virtual | ~CompositorShadowNode () |
const CompositorPassVec & | _getPasses () const |
void | _notifyCleared () |
Internal Use. More... | |
bool | _shouldUpdateShadowMapIdx (uint32 shadowMapIdx) const |
void | _update (Camera *camera, const Camera *lodCamera, SceneManager *sceneManager) |
Renders into the shadow map, executes passes. More... | |
void | _update (const Camera *lodCamera, SceneManager *sceneManager) |
Calling this function every frame will cause us to execute all our passes (ie. More... | |
bool | areAllInputsConnected () const |
void | connectBufferTo (size_t outChannelA, CompositorNode *nodeB, size_t inChannelB) |
Connects this node (let's call it node 'A') to node 'B', mapping the output channel from A into the input channel from B (buffer version) More... | |
void | connectExternalBuffer (UavBufferPacked *buffer, size_t inChannelA) |
Connects (injects) an external buffer into the given channel. More... | |
void | connectExternalRT (TextureGpu *externalTexture, size_t inChannelA) |
Connects (injects) an external RT into the given channel. More... | |
void | connectTo (size_t outChannelA, CompositorNode *nodeB, size_t inChannelB) |
Connects this node (let's call it node 'A') to node 'B', mapping the output channel from A into the input channel from B (texture version) More... | |
void | createPasses () |
Creates all passes based on our definition. More... | |
void | destroyAllPasses () |
void | finalTargetResized01 (const TextureGpu *finalTarget) override |
virtual void | finalTargetResized02 (const TextureGpu *finalTarget) |
const LightsBitSet & | getAffectedLightsBitSet () const |
const AxisAlignedBox & | getCastersBox () const |
@See mCastersBox More... | |
const TextureGpuVec & | getContiguousShadowMapTex () const |
UavBufferPacked * | getDefinedBuffer (IdString bufferName) const |
Returns the buffer pointer of a buffer based on it's name. More... | |
UavBufferPacked * | getDefinedBufferNoThrow (IdString bufferName) const |
TextureGpu * | getDefinedTexture (IdString textureName) const |
Returns the texture pointer of a texture based on it's name & mrt index. More... | |
const CompositorShadowNodeDef * | getDefinition () const |
bool | getEnabled () const |
Returns if this instance is enabled. @See setEnabled. More... | |
IdType | getId () const |
Get the unique id of this object. More... | |
uint32 | getIndexToContiguousShadowMapTex (size_t shadowMapIdx) const |
const CompositorChannelVec & | getInputChannel () const |
const Light * | getLightAssociatedWith (uint32 shadowMapIdx) const |
Note: May return null if there is no such shadowMapIdx, or if there is no light that could be linked with that shadow map index. More... | |
const CompositorChannelVec & | getLocalTextures () const |
void | getMinMaxDepthRange (const Frustum *shadowMapCamera, Real &outMin, Real &outMax) const |
Outputs the min & max depth range for the given camera. More... | |
void | getMinMaxDepthRange (size_t shadowMapIdx, Real &outMin, Real &outMax) const |
IdString | getName () const |
float | getNormalOffsetBias (const size_t shadowMapIdx) const |
size_t | getNumActiveShadowCastingLights () const |
The return value may change in the future, which happens when the number of lights changes to or from a value lower than the supported shadow casting lights by the definition. More... | |
size_t | getPassNumber (CompositorPass *pass) const |
const vector< Real >::type * | getPssmBlends (size_t shadowMapIdx) const |
Returns a list of points with the blend band boundaries of the closest N-1 PSSM split in projection space for the given shadow map index. More... | |
const Real * | getPssmFade (size_t shadowMapIdx) const |
Returns the fade point of the last PSSM split in projection space for the given shadow map index. More... | |
const vector< Real >::type * | getPssmSplits (size_t shadowMapIdx) const |
Returns a list of points with the limits of each PSSM split in projection space for the given shadow map index. More... | |
RenderSystem * | getRenderSystem () const |
const LightClosestArray & | getShadowCastingLights () const |
uint8 | getShadowMapLightTypeMask (uint32 shadowMapIdx) const |
Do not call this if isShadowMapIdxActive == false or isShadowMapIdxInValidRange == false. More... | |
const Matrix4 & | getViewMatrix (size_t shadowMapIdx) const |
Returns the texture view matrix for the given shadow map index. More... | |
Matrix4 | getViewProjectionMatrix (size_t shadowMapIdx) const |
Returns the texture view projection matrix for the given shadow map index. More... | |
CompositorWorkspace * | getWorkspace () |
Returns our parent workspace. More... | |
const CompositorWorkspace * | getWorkspace () const |
Returns our parent workspace. More... | |
bool | isShadowMapIdxActive (uint32 shadowMapIdx) const |
Returns true if the shadow map index is not active. More... | |
bool | isShadowMapIdxInValidRange (uint32 shadowMapIdx) const |
void | notifyDestroyed (const UavBufferPacked *buffer) |
void | notifyDestroyed (TextureGpu *channel) |
Call this function when caller has destroyed a RenderTarget in which the callee may have a reference to that pointer, so that we can clean it up. More... | |
void | notifyRecreated (const UavBufferPacked *oldBuffer, UavBufferPacked *newBuffer) |
void | notifyRecreated (TextureGpu *channel) |
Call this function when you're replacing the textures from oldChannel with the ones in newChannel. More... | |
void | operator delete (void *ptr) |
void | operator delete (void *ptr, const char *, int, const char *) |
void | operator delete (void *ptr, void *) |
void | operator delete[] (void *ptr) |
void | operator delete[] (void *ptr, const char *, int, const char *) |
void * | operator new (size_t sz) |
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 *ptr) |
placement operator new More... | |
void * | operator new[] (size_t sz) |
void * | operator new[] (size_t sz, const char *file, int line, const char *func) |
array operator new, with debug line info More... | |
bool | operator() (const IdObject &left, const IdObject &right) |
bool | operator() (const IdObject *left, const IdObject *right) |
void | postInitializePass (CompositorPass *pass) override |
We derive so we can override the camera with ours. More... | |
void | resetAllNumPassesLeft () |
Resets the number of passes left for every pass (. More... | |
void | setEnabled (bool bEnabled) |
Enables or disables all instances of this node. More... | |
void | setLightFixedToShadowMap (size_t shadowMapIdx, Light *light) |
Marks a shadow map as statically updated, and ties the given light to always use that shadow map. More... | |
const LightList * | setShadowMapsToPass (Renderable *rend, const Pass *pass, AutoParamDataSource *autoParamDataSource, size_t startLight) |
void | setStaticShadowMapDirty (size_t shadowMapIdx, bool includeLinked=true) |
Tags a static shadow map as dirty, causing Ogre to update it on the next time this Shadow node gets executed. More... | |
Shadow Nodes are special nodes (not to be confused with.
To summarize: a normal rendering flow with shadow map looks like this: shadowNode->setupShadowCamera( normal->getVisibleBoundsInfo() ); shadowNode->_cullPhase01(); shadowNode->_renderPhase02(); normal->_cullPhase01(); normal->_renderPhase02();
typedef vector<bool>::type Ogre::CompositorShadowNode::LightsBitSet |
Ogre::CompositorShadowNode::CompositorShadowNode | ( | IdType | id, |
const CompositorShadowNodeDef * | definition, | ||
CompositorWorkspace * | workspace, | ||
RenderSystem * | renderSys, | ||
TextureGpu * | finalTarget | ||
) |
|
virtual |
|
inlineinherited |
|
inherited |
Internal Use.
Called when connections are all being zero'ed. We rely our caller is doing this to all nodes, hence we do not notify our @mConnectedNodes nodes. Failing to clear them too may leave dangling pointers or graphical glitches
bool Ogre::CompositorShadowNode::_shouldUpdateShadowMapIdx | ( | uint32 | shadowMapIdx | ) | const |
void Ogre::CompositorShadowNode::_update | ( | Camera * | camera, |
const Camera * | lodCamera, | ||
SceneManager * | sceneManager | ||
) |
Renders into the shadow map, executes passes.
camera | Camera used to calculate our shadow camera (in case of directional lights). |
|
inherited |
Calling this function every frame will cause us to execute all our passes (ie.
render)
lodCamera | LOD Camera to be used by our passes. Pointer can be null, and note however passes can ignore this hint and use their own camera pointer for LOD (this parameter is mostly used for syncing shadow mapping). |
|
inherited |
|
inherited |
Connects this node (let's call it node 'A') to node 'B', mapping the output channel from A into the input channel from B (buffer version)
outChannelA | Output to use from node A. |
inChannelB | Input to connect the output from A. |
|
inherited |
Connects (injects) an external buffer into the given channel.
Usually used for the 'connect_buffer_external' directive.
buffer | The buffer. |
inChannelA | In which channel number to inject to. |
|
inherited |
Connects (injects) an external RT into the given channel.
Usually used for the "connect_output" / "connect_external" directive for the RenderWindow.
rt | The RenderTarget. |
textures | The Textures associated with the RT. Can be empty (eg. RenderWindow) but could cause crashes/exceptions if tried to use in PASS_QUAD passes. |
inChannelA | In which channel number to inject to. |
|
inherited |
Connects this node (let's call it node 'A') to node 'B', mapping the output channel from A into the input channel from B (texture version)
outChannelA | Output to use from node A. |
inChannelB | Input to connect the output from A. |
|
inherited |
Creates all passes based on our definition.
|
inherited |
|
overridevirtual |
Reimplemented from Ogre::CompositorNode.
|
virtualinherited |
|
inline |
|
inline |
@See mCastersBox
|
inline |
|
inherited |
Returns the buffer pointer of a buffer based on it's name.
bufferName | The name of the buffer. This name may only be valid at node scope. It can refer to an input buffer, a local buffer, or a global one. If a local or input buffer has the same name as a global one, the global one is ignored. |
|
inherited |
|
inherited |
Returns the texture pointer of a texture based on it's name & mrt index.
textureName | The name of the texture. This name may only be valid at node scope. It can refer to an input texture, a local texture, or a global one. If the global texture wasn't registered with addTextureSourceName, it will fail. |
|
inline |
|
inlineinherited |
Returns if this instance is enabled. @See setEnabled.
|
inlineinherited |
Get the unique id of this object.
uint32 Ogre::CompositorShadowNode::getIndexToContiguousShadowMapTex | ( | size_t | shadowMapIdx | ) | const |
|
inlineinherited |
Note: May return null if there is no such shadowMapIdx, or if there is no light that could be linked with that shadow map index.
i.e. if isShadowMapIdxActive( shadowMapIdx ) is true, then we'll return a valid pointer.
|
inlineinherited |
void Ogre::CompositorShadowNode::getMinMaxDepthRange | ( | const Frustum * | shadowMapCamera, |
Real & | outMin, | ||
Real & | outMax | ||
) | const |
Outputs the min & max depth range for the given camera.
0 & 100000 if camera not found
void Ogre::CompositorShadowNode::getMinMaxDepthRange | ( | size_t | shadowMapIdx, |
Real & | outMin, | ||
Real & | outMax | ||
) | const |
|
inlineinherited |
float Ogre::CompositorShadowNode::getNormalOffsetBias | ( | const size_t | shadowMapIdx | ) | const |
|
inline |
The return value may change in the future, which happens when the number of lights changes to or from a value lower than the supported shadow casting lights by the definition.
|
inherited |
const vector<Real>::type* Ogre::CompositorShadowNode::getPssmBlends | ( | size_t | shadowMapIdx | ) | const |
Returns a list of points with the blend band boundaries of the closest N-1 PSSM split in projection space for the given shadow map index.
const Real* Ogre::CompositorShadowNode::getPssmFade | ( | size_t | shadowMapIdx | ) | const |
Returns the fade point of the last PSSM split in projection space for the given shadow map index.
const vector<Real>::type* Ogre::CompositorShadowNode::getPssmSplits | ( | size_t | shadowMapIdx | ) | const |
Returns a list of points with the limits of each PSSM split in projection space for the given shadow map index.
|
inlineinherited |
|
inline |
Do not call this if isShadowMapIdxActive == false or isShadowMapIdxInValidRange == false.
const Matrix4& Ogre::CompositorShadowNode::getViewMatrix | ( | size_t | shadowMapIdx | ) | const |
Returns the texture view matrix for the given shadow map index.
Matrix4 Ogre::CompositorShadowNode::getViewProjectionMatrix | ( | size_t | shadowMapIdx | ) | const |
Returns the texture view projection matrix for the given shadow map index.
|
inlineinherited |
Returns our parent workspace.
|
inlineinherited |
Returns our parent workspace.
bool Ogre::CompositorShadowNode::isShadowMapIdxActive | ( | uint32 | shadowMapIdx | ) | const |
Returns true if the shadow map index is not active.
For example:
bool Ogre::CompositorShadowNode::isShadowMapIdxInValidRange | ( | uint32 | shadowMapIdx | ) | const |
|
inherited |
|
inherited |
Call this function when caller has destroyed a RenderTarget in which the callee may have a reference to that pointer, so that we can clean it up.
channel | Channel containing the pointer about to be destroyed (must still be valid) |
|
inherited |
|
inherited |
Call this function when you're replacing the textures from oldChannel with the ones in newChannel.
Useful when recreating textures (i.e. resolution changed)
oldChannel | The old textures that are going to be removed. Pointers in it must be still valid |
newChannel | The new replacement textures |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
operator new, with debug line info
|
inlineinherited |
placement operator new
|
inlineinherited |
|
inlineinherited |
array operator new, with debug line info
|
overridevirtual |
We derive so we can override the camera with ours.
Reimplemented from Ogre::CompositorNode.
|
inherited |
Resets the number of passes left for every pass (.
|
inherited |
Enables or disables all instances of this node.
void Ogre::CompositorShadowNode::setLightFixedToShadowMap | ( | size_t | shadowMapIdx, |
Light * | light | ||
) |
Marks a shadow map as statically updated, and ties the given light to always use that shadow map.
shadowMapIdx | Shadow map index to tie this light to. If this shadow map index is part of a PSSM split, all PSSM splits will be affected (thus you only need to call it once for any of the split that belong to the same set) |
light | Light to tie to the given shadow map. Null pointer disables it. |
const LightList* Ogre::CompositorShadowNode::setShadowMapsToPass | ( | Renderable * | rend, |
const Pass * | pass, | ||
AutoParamDataSource * | autoParamDataSource, | ||
size_t | startLight | ||
) |
void Ogre::CompositorShadowNode::setStaticShadowMapDirty | ( | size_t | shadowMapIdx, |
bool | includeLinked = true |
||
) |
Tags a static shadow map as dirty, causing Ogre to update it on the next time this Shadow node gets executed.
If drawing to a texture atlas, multiple shadow maps may be sharing the same texture, thus if you're doing a clear on the whole atlas, you will need to update all of the shadow maps, not just this one. Use includeLinked=true to mark as dirty all static shadow maps that share the same atlas. Set it to false if that's explicitly what you want, or if you're already going to call it for every shadow map (otherwise you will trigger a O(N^2) behavior).