![]() |
OGRE-Next 4.0.0unstable
Object-Oriented Graphics Rendering Engine
|
Compositor nodes are the core subject of compositing. More...
#include <OgreCompositorNode.h>
Public Member Functions | |
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. | |
virtual | ~CompositorNode () |
const CompositorPassVec & | _getPasses () const |
void | _notifyCleared () |
Internal Use. | |
void | _update (const Camera *lodCamera, SceneManager *sceneManager) |
Calling this function every frame will cause us to execute all our passes (ie. | |
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) | |
void | connectExternalBuffer (UavBufferPacked *buffer, size_t inChannelA) |
Connects (injects) an external buffer into the given channel. | |
void | connectExternalRT (TextureGpu *externalTexture, size_t inChannelA) |
Connects (injects) an external RT into the given channel. | |
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) | |
void | createPasses () |
Creates all passes based on our definition. | |
void | destroyAllPasses () |
virtual void | finalTargetResized01 (const TextureGpu *finalTarget) |
Called by CompositorManager2 when (i.e.) the RenderWindow was resized, thus our RTs that depend on their resolution need to be recreated. | |
virtual void | finalTargetResized02 (const TextureGpu *finalTarget) |
UavBufferPacked * | getDefinedBuffer (IdString bufferName) const |
Returns the buffer pointer of a buffer based on it's name. | |
UavBufferPacked * | getDefinedBufferNoThrow (IdString bufferName) const |
TextureGpu * | getDefinedTexture (IdString textureName) const |
Returns the texture pointer of a texture based on it's name & mrt index. | |
const CompositorNodeDef * | getDefinition () const |
bool | getEnabled () const |
Returns if this instance is enabled. | |
const CompositorChannelVec & | getInputChannel () const |
const CompositorChannelVec & | getLocalTextures () const |
IdString | getName () const |
size_t | getPassNumber (CompositorPass *pass) const |
See CompositorNodeDef::getPassNumber. | |
RenderSystem * | getRenderSystem () const |
CompositorWorkspace * | getWorkspace () |
Returns our parent workspace. | |
const CompositorWorkspace * | getWorkspace () const |
Returns our parent workspace. | |
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. | |
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. | |
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. | |
void | setEnabled (bool bEnabled) |
Enables or disables all instances of this node. | |
![]() | |
IdObject (IdType id) | |
We don't call generateNewId() here, to prevent objects in the stack (i.e. | |
IdType | getId () const |
Get the unique id of this object. | |
bool | operator() (const IdObject &left, const IdObject &right) |
bool | operator() (const IdObject *left, const IdObject *right) |
Compositor nodes are the core subject of compositing.
This is an instantiation. All const, shared parameters are in the definition (CompositorNodeDef) and we assume they don't change throughout the lifetime of our instance.
Ogre::CompositorNode::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.
The name is only unique across the workspace
|
virtual |
|
inline |
void Ogre::CompositorNode::_notifyCleared | ( | ) |
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 CompositorNode::mConnectedNodes nodes. Failing to clear them too may leave dangling pointers or graphical glitches
void Ogre::CompositorNode::_update | ( | const Camera * | lodCamera, |
SceneManager * | sceneManager | ||
) |
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). |
bool Ogre::CompositorNode::areAllInputsConnected | ( | ) | const |
void Ogre::CompositorNode::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)
outChannelA | Output to use from node A. |
inChannelB | Input to connect the output from A. |
void Ogre::CompositorNode::connectExternalBuffer | ( | UavBufferPacked * | buffer, |
size_t | inChannelA | ||
) |
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. |
void Ogre::CompositorNode::connectExternalRT | ( | TextureGpu * | externalTexture, |
size_t | inChannelA | ||
) |
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. |
void Ogre::CompositorNode::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)
outChannelA | Output to use from node A. |
inChannelB | Input to connect the output from A. |
void Ogre::CompositorNode::createPasses | ( | ) |
Creates all passes based on our definition.
void Ogre::CompositorNode::destroyAllPasses | ( | ) |
|
virtual |
Called by CompositorManager2 when (i.e.) the RenderWindow was resized, thus our RTs that depend on their resolution need to be recreated.
finalTarget | The Final Target (i.e. RenderWindow) from which we'll base our local textures' resolution. |
Reimplemented in Ogre::CompositorShadowNode.
|
virtual |
UavBufferPacked * Ogre::CompositorNode::getDefinedBuffer | ( | IdString | bufferName | ) | const |
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. |
UavBufferPacked * Ogre::CompositorNode::getDefinedBufferNoThrow | ( | IdString | bufferName | ) | const |
TextureGpu * Ogre::CompositorNode::getDefinedTexture | ( | IdString | textureName | ) | const |
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 |
|
inline |
Returns if this instance is enabled.
|
inline |
|
inline |
|
inline |
size_t Ogre::CompositorNode::getPassNumber | ( | CompositorPass * | pass | ) | const |
|
inline |
|
inline |
Returns our parent workspace.
|
inline |
Returns our parent workspace.
void Ogre::CompositorNode::notifyDestroyed | ( | const UavBufferPacked * | buffer | ) |
void Ogre::CompositorNode::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.
channel | Channel containing the pointer about to be destroyed (must still be valid) |
void Ogre::CompositorNode::notifyRecreated | ( | const UavBufferPacked * | oldBuffer, |
UavBufferPacked * | newBuffer | ||
) |
void Ogre::CompositorNode::notifyRecreated | ( | TextureGpu * | channel | ) |
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 |
void Ogre::CompositorNode::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.
void Ogre::CompositorNode::setEnabled | ( | bool | bEnabled | ) |
Enables or disables all instances of this node.