|
| CompositorShadowNode (IdType id, const CompositorShadowNodeDef *definition, CompositorWorkspace *workspace, RenderSystem *renderSys, TextureGpu *finalTarget) |
|
| ~CompositorShadowNode () override |
|
bool | _shouldUpdateShadowMapIdx (uint32 shadowMapIdx) const |
|
void | _update (Camera *camera, const Camera *lodCamera, SceneManager *sceneManager) |
| Renders into the shadow map, executes passes. More...
|
|
void | finalTargetResized01 (const TextureGpu *finalTarget) override |
| Called by CompositorManager2 when (i.e.) the RenderWindow was resized, thus our RTs that depend on their resolution need to be recreated. More...
|
|
const LightsBitSet & | getAffectedLightsBitSet () const |
|
const AxisAlignedBox & | getCastersBox () const |
|
const TextureGpuVec & | getContiguousShadowMapTex () const |
|
const CompositorShadowNodeDef * | getDefinition () const |
|
uint32 | getIndexToContiguousShadowMapTex (size_t shadowMapIdx) const |
|
const Light * | getLightAssociatedWith (size_t 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...
|
|
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 |
|
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...
|
|
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...
|
|
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...
|
|
bool | isShadowMapIdxActive (size_t shadowMapIdx) const |
| Returns true if the shadow map index is not active. More...
|
|
bool | isShadowMapIdxInValidRange (uint32 shadowMapIdx) const |
|
void | postInitializePass (CompositorPass *pass) override |
| We derive so we can override the camera with ours. 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...
|
|
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...
|
|
| CompositorNode (IdType id, IdString name, const CompositorNodeDef *definition, CompositorWorkspace *workspace, RenderSystem *renderSys, TextureGpu *finalTarget) |
| The Id must be unique across all engine so we can create unique named textures. More...
|
|
virtual | ~CompositorNode () |
|
const CompositorPassVec & | _getPasses () const |
|
void | _notifyCleared () |
| Internal Use. 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 () |
|
virtual void | finalTargetResized02 (const TextureGpu *finalTarget) |
|
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 CompositorNodeDef * | getDefinition () const |
|
bool | getEnabled () const |
| Returns if this instance is enabled. More...
|
|
const CompositorChannelVec & | getInputChannel () const |
|
const CompositorChannelVec & | getLocalTextures () const |
|
IdString | getName () const |
|
size_t | getPassNumber (CompositorPass *pass) const |
| See CompositorNodeDef::getPassNumber. More...
|
|
RenderSystem * | getRenderSystem () const |
|
CompositorWorkspace * | getWorkspace () |
| Returns our parent workspace. More...
|
|
const CompositorWorkspace * | getWorkspace () const |
| Returns our parent workspace. More...
|
|
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 | resetAllNumPassesLeft () |
| Resets the number of passes left for every pass (see CompositorPassDef::mNumInitialPasses) Useful when you have a few starting 'initialization' passes and you want to reset them. More...
|
|
void | setEnabled (bool bEnabled) |
| Enables or disables all instances of this node. 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) |
|
Shadow Nodes are special nodes (not to be confused with CompositorNode) that are only used for rendering shadow maps.
Normal Compositor Nodes can share or own a ShadowNode. The ShadowNode will render the scene enough times to fill all shadow maps so the main scene pass can use them.
- ShadowNode are very flexible compared to Ogre 1.x; as they allow mixing multiple shadow camera setups for different lights.
- Shadow Nodes derive from nodes so that they can be used as regular nodes
- During a render with shadow mapping enabled, we render first the Shadow Node's pass, then render the regular scene. In the past there used to be an AABB enclosing all visible objects that receive shadows that was used for calculating the shadow maps. This forced Ogre 2.x to split rendering into two stages: _cullPhase01 & _renderPhase02. This is not needed anymore.
To summarize: a normal rendering flow with shadow map looks like this: shadowNode->setupShadowCamera( normal->getVisibleBoundsInfo() ); shadowNode->_cullPhase01(); shadowNode->_renderPhase02(); normal->_cullPhase01(); normal->_renderPhase02();
- On forward lighting passes, shadow mapping is handled in the following way: 1) Build a list of all lights visible by all cameras (SceneManager does this) 2) Traverse the list to get the closest lights to the current camera. These lights will cast shadows. 3) Build a list of the closest lights for each object (SceneManager does this) 4) Traverse this list and find those that are actually casting a shadow 5) Send to the GPU & engine the list in step 4, but shadow casting lights are put first, then sorted by proximity. See the comments inside the function setShadowMapsToPass for more information.
- Author
- Matias N. Goldberg
- Version
- 1.0