OGRE 2.1
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, const RenderTarget *finalTarget) | |
The Id must be unique across all engine so we can create unique named textures. | |
virtual | ~CompositorNode () |
const CompositorChannel * | _getDefinedTexture (IdString textureName) const |
const CompositorPassVec & | _getPasses () const |
void | _notifyCleared (void) |
Internal Use. | |
void | _placeBarriersAndEmulateUavExecution (BoundUav boundUavs[64], ResourceAccessMap &uavsAccess, ResourceLayoutMap &resourcesLayout) |
void | _removeAllBarriers (void) |
void | _setFinalTargetAsRenderTarget (ResourceLayoutMap::iterator finalTargetCurrentLayout) |
Places a resource transition in our last pass to the given RenderTarget. | |
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 (const CompositorChannel &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 (void) |
Creates all passes based on our definition. | |
virtual void | finalTargetResized (const RenderTarget *finalTarget) |
Called by CompositorManager2 when (i.e.) the RenderWindow was resized, thus our RTs that depend on their resolution need to be recreated. | |
UavBufferPacked * | getDefinedBuffer (IdString bufferName) const |
Returns the buffer pointer of a buffer based on it's name. | |
UavBufferPacked * | getDefinedBufferNoThrow (IdString bufferName) const |
TexturePtr | getDefinedTexture (IdString textureName, size_t mrtIndex) const |
Returns the texture pointer of a texture based on it's name & mrt index. | |
const CompositorNodeDef * | getDefinition () const |
bool | getEnabled (void) const |
Returns if this instance is enabled. @See setEnabled. | |
IdType | getId () const |
Get the unique id of this object. | |
const CompositorChannelVec & | getInputChannel () const |
const CompositorChannelVec & | getLocalTextures () const |
IdString | getName (void) const |
size_t | getPassNumber (CompositorPass *pass) const |
RenderSystem * | getRenderSystem (void) const |
CompositorWorkspace * | getWorkspace (void) |
Returns our parent workspace. | |
const CompositorWorkspace * | getWorkspace (void) const |
Returns our parent workspace. | |
void | notifyDestroyed (const CompositorChannel &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 | notifyDestroyed (const UavBufferPacked *buffer) |
void | notifyRecreated (const CompositorChannel &oldChannel, const CompositorChannel &newChannel) |
Call this function when you're replacing the textures from oldChannel with the ones in newChannel. | |
void | notifyRecreated (const UavBufferPacked *oldBuffer, UavBufferPacked *newBuffer) |
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 | |
void * | operator new (size_t sz, void *ptr) |
placement operator new | |
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 | |
bool | operator() (const IdObject &left, const IdObject &right) |
bool | operator() (const IdObject *left, const IdObject *right) |
void | resetAllNumPassesLeft (void) |
Resets the number of passes left for every pass (. | |
void | setEnabled (bool bEnabled) |
Enables or disables all instances of this node. | |
Static Public Member Functions | |
static void | fillResourcesLayout (ResourceLayoutMap &outResourcesLayout, const CompositorChannelVec &compositorChannels, ResourceLayout::Layout layout) |
Overrides a resource with the given layout if it's already in outResourcesLayout. | |
static void | initResourcesLayout (ResourceLayoutMap &outResourcesLayout, const CompositorChannelVec &compositorChannels, ResourceLayout::Layout layout) |
Only inits a resource with the given layout if it wasn't already in outResourcesLayout. | |
static void | initResourcesLayout (ResourceLayoutMap &outResourcesLayout, const CompositorNamedBufferVec &buffers, ResourceLayout::Layout layout) |
Only inits a resource with the given layout if it wasn't already in outResourcesLayout. | |
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, | ||
const RenderTarget * | 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 |
const CompositorChannel * Ogre::CompositorNode::_getDefinedTexture | ( | IdString | textureName | ) | const |
|
inline |
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
void Ogre::CompositorNode::_placeBarriersAndEmulateUavExecution | ( | BoundUav | boundUavs[64], |
ResourceAccessMap & | uavsAccess, | ||
ResourceLayoutMap & | resourcesLayout | ||
) |
void Ogre::CompositorNode::_setFinalTargetAsRenderTarget | ( | ResourceLayoutMap::iterator | finalTargetCurrentLayout | ) |
Places a resource transition in our last pass to the given RenderTarget.
Usually needed to ensure the final 'RenderWindow' is still a RenderTarget after the workspace is finished.
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 | ( | const CompositorChannel & | 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. |
Creates all passes based on our definition.
|
static |
Overrides a resource with the given layout if it's already in outResourcesLayout.
|
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.
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 |
TexturePtr Ogre::CompositorNode::getDefinedTexture | ( | IdString | textureName, |
size_t | mrtIndex | ||
) | 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. |
mrtIndex | The MRT (Multiple Render Target) index. If the texture isn't MRT or has less RTs than the index, it returns the highest valid index found. |
|
inline |
Returns if this instance is enabled. @See setEnabled.
|
inlineinherited |
Get the unique id of this object.
|
inline |
|
inline |
size_t Ogre::CompositorNode::getPassNumber | ( | CompositorPass * | pass | ) | const |
|
inline |
|
inline |
Returns our parent workspace.
|
inline |
Returns our parent workspace.
|
static |
Only inits a resource with the given layout if it wasn't already in outResourcesLayout.
|
static |
Only inits a resource with the given layout if it wasn't already in outResourcesLayout.
void Ogre::CompositorNode::notifyDestroyed | ( | const CompositorChannel & | 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::notifyDestroyed | ( | const UavBufferPacked * | buffer | ) |
void Ogre::CompositorNode::notifyRecreated | ( | const CompositorChannel & | oldChannel, |
const CompositorChannel & | newChannel | ||
) |
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::notifyRecreated | ( | const UavBufferPacked * | oldBuffer, |
UavBufferPacked * | newBuffer | ||
) |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
operator new, with debug line info
placement operator new
|
inlineinherited |
|
inlineinherited |
array operator new, with debug line info
Resets the number of passes left for every pass (.
Enables or disables all instances of this node.