OGRE
2.2.4
Object-Oriented Graphics Rendering Engine
|
#include <OgreCompositorWorkspaceDef.h>
Classes | |
struct | ChannelRoute |
Public Types | |
typedef vector< BufferDefinition >::type | BufferDefinitionVec |
typedef list< ChannelRoute >::type | ChannelRouteList |
typedef map< IdString, IdString >::type | NodeAliasMap |
typedef vector< PixelFormatGpu >::type | PixelFormatGpuVec |
typedef vector< TextureDefinition >::type | TextureDefinitionVec |
enum | TextureSource { TEXTURE_INPUT, TEXTURE_LOCAL, TEXTURE_GLOBAL, NUM_TEXTURES_SOURCES } |
Public Member Functions | |
CompositorWorkspaceDef (const String &name, CompositorManager2 *compositorManager) | |
virtual | ~CompositorWorkspaceDef () |
ChannelRouteList & | _getChannelRoutes (void) |
Gets direct access to the channel route (aka the interconnections between all of our nodes). More... | |
void | addBufferDefinition (IdString name, size_t numElements, uint32 bytesPerElement, uint32 bindFlags, float widthFactor, float heightFactor) |
Creates an UAV buffer. More... | |
virtual void | addBufferInput (size_t inputChannel, IdString name) |
Buffers. More... | |
void | addNodeAlias (IdString alias, IdString nodeName) |
An alias is explicitly used when the user wants to use multiple, independent instances of the same node. More... | |
RenderTargetViewDef * | addRenderTextureView (IdString name) |
TextureDefinition * | addTextureDefinition (const String &name) |
Creates a TextureDefinition with a given name, must be unique. More... | |
virtual IdString | addTextureSourceName (const String &name, size_t index, TextureSource textureSource) |
Adds a texture name, whether a real one or an alias, and where to grab it from. More... | |
void | clearAll (void) |
Clears everything: All node aliases, and their connections (including output connection). More... | |
void | clearAllInterNodeConnections (void) |
Clears all the connection between channels of the nodes (. More... | |
void | clearOutputConnections (void) |
Clears the connection from the "final output RenderTarget" (i.e. More... | |
void | connect (IdString outNode, uint32 outChannel, IdString inNode, uint32 inChannel) |
Connects outNode's output channel to inNode's input channel. More... | |
void | connect (IdString outNode, IdString inNode) |
Connects all outputs channels from outNode to all input channels from inNode. More... | |
void | connectBuffer (IdString outNode, uint32 outChannel, IdString inNode, uint32 inChannel) |
Connects outNode's output buffer channel to inNode's input buffer channel. More... | |
void | connectBuffer (IdString outNode, IdString inNode) |
Connects all output buffer channels from outNode to all input buffer channels from inNode. More... | |
void | connectExternal (uint32 externalIdx, IdString inNode, uint32 inChannel) |
Connects the (probably "final") node by passing the RenderWindow in the given input channel. More... | |
void | connectExternalBuffer (uint32 externalBufferIdx, IdString inNode, uint32 inChannel) |
Connects an external buffer to the given input channel. More... | |
CompositorManager2 * | getCompositorManager (void) const |
const BufferDefinitionVec & | getLocalBufferDefinitions (void) const |
BufferDefinitionVec & | getLocalBufferDefinitionsNonConst (void) |
Returns the local buffer definitions. More... | |
const TextureDefinitionVec & | getLocalTextureDefinitions (void) const |
TextureDefinitionVec & | getLocalTextureDefinitionsNonConst (void) |
Returns the local texture definitions. More... | |
IdString | getName (void) const |
String | getNameStr (void) const |
const NameToChannelMap & | getNameToChannelMap (void) const |
const NodeAliasMap & | getNodeAliasMap (void) |
Gets read-only access to the map to all added nodes and their aliases. More... | |
size_t | getNumInputBufferChannels (void) const |
size_t | getNumInputChannels (void) const |
This has O(N) complexity! (not cached, we look in mNameToChannelMap) More... | |
const RenderTargetViewDef * | getRenderTargetViewDef (IdString name) const |
RenderTargetViewDef * | getRenderTargetViewDefNonConstNoThrow (IdString name) |
void | getTextureSource (IdString name, size_t &index, TextureSource &textureSource) const |
Retrieves in which container to look for when looking to which texture is a given name associated with. More... | |
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 | removeAllRenderTextureViews (void) |
virtual void | removeBuffer (IdString name) |
Remove a buffer. Buffer can come from an input channel, or a locally defined one. More... | |
void | removeNodeAlias (IdString alias) |
Removes a particular Node. More... | |
void | removeRenderTextureView (IdString name) |
virtual void | removeTexture (IdString name) |
WARNING: Be very careful with this function. More... | |
void | renameBuffer (IdString oldName, const String &newName) |
Changes the name of a buffer. More... | |
void | renameTexture (IdString oldName, const String &newName) |
Changes the name of a texture. More... | |
void | setNumLocalBufferDefinitions (size_t numTDs) |
Reserves enough memory for all texture definitions. More... | |
void | setNumLocalTextureDefinitions (size_t numTDs) |
Reserves enough memory for all texture definitions. More... | |
Static Public Member Functions | |
static UavBufferPacked * | createBuffer (const BufferDefinition &bufferDef, const TextureGpu *finalTarget, VaoManager *vaoManager) |
static void | createBuffers (const BufferDefinitionVec &bufferDefs, CompositorNamedBufferVec &inOutBufContainer, const TextureGpu *finalTarget, RenderSystem *renderSys) |
Utility function to create the buffers based on a given set of buffer definitions and put them in a container. More... | |
static CompositorChannel | createTexture (const TextureDefinition &textureDef, const String &texName, const TextureGpu *finalTarget, RenderSystem *renderSys) |
static void | createTextures (const TextureDefinitionVec &textureDefs, CompositorChannelVec &inOutTexContainer, IdType id, const TextureGpu *finalTarget, RenderSystem *renderSys) |
Utility function to create the textures based on a given set of texture definitions and put them in a container. More... | |
static void | destroyBuffers (const BufferDefinitionVec &bufferDefs, CompositorNamedBufferVec &inOutBufContainer, RenderSystem *renderSys) |
static void | destroyTextures (CompositorChannelVec &inOutTexContainer, RenderSystem *renderSys) |
createTextures More... | |
static void | recreateResizableBuffers (const BufferDefinitionVec &bufferDefs, CompositorNamedBufferVec &inOutBufContainer, const TextureGpu *finalTarget, RenderSystem *renderSys, const CompositorNodeVec &connectedNodes, const CompositorPassVec *passes) |
Destroys & recreates only the buffers that depend on the main RT (i.e. More... | |
static void | recreateResizableTextures01 (const TextureDefinitionVec &textureDefs, CompositorChannelVec &inOutTexContainer, const TextureGpu *finalTarget) |
Destroys & recreates only the textures that depend on the main RT (e.g. More... | |
static void | recreateResizableTextures02 (const TextureDefinitionVec &textureDefs, CompositorChannelVec &inOutTexContainer, const CompositorNodeVec &connectedNodes, const CompositorPassVec *passes) |
See recreateResizableTextures01 Updates involved RenderPassDescriptors. More... | |
static void | setupTexture (TextureGpu *tex, const TextureDefinition &textureDef, const TextureGpu *finalTarget) |
Friends | |
class | CompositorWorkspace |
Workspace definitions assume all other definitions are already parsed as we need them to perform validation checks. Workspace definitions work by assigning aliases to each node. A node whose name is the same as its alias is called an implicit alias.
|
inherited |
typedef list<ChannelRoute>::type Ogre::CompositorWorkspaceDef::ChannelRouteList |
typedef map<IdString, IdString>::type Ogre::CompositorWorkspaceDef::NodeAliasMap |
|
inherited |
|
inherited |
|
inherited |
Ogre::CompositorWorkspaceDef::CompositorWorkspaceDef | ( | const String & | name, |
CompositorManager2 * | compositorManager | ||
) |
|
inlinevirtual |
|
inline |
Gets direct access to the channel route (aka the interconnections between all of our nodes).
Useful for advanced C++ users who want fine control of the connections.
|
inherited |
Creates an UAV buffer.
name | Name to give to this buffer for referencing it locally from this scope. Duplicate names (including names from addBufferInput) will raise an exception when trying to instantiate the workspace. |
bindFlags | Bitmask. |
widthFactor |
heightFactor |
|
virtualinherited |
Buffers.
Specifies that buffer incoming from channel 'inputChannel' will be referenced by the name 'name'
inputChannel | Input channel # the buffer comes from. |
name | Name to give to this buffer for referencing it locally from this scope. Duplicate names (including names from addBufferDefinition) will raise an exception when trying to instantiate the workspace. |
Reimplemented in Ogre::CompositorShadowNodeDef.
An alias is explicitly used when the user wants to use multiple, independent instances of the same node.
Each alias equals one instance. An implicit alias is when the name of the alias and it's node name match.
alias | Name of the alias (instance). May be equal to nodeName. |
nodeName | Name of the node definition |
|
inherited |
|
inherited |
Creates a TextureDefinition with a given name, must be unique.
name | The name of the texture. Names are usually valid only throughout this node. We need the name, not its hash because we need to validate the global_ prefix is used correctly. |
|
virtualinherited |
Adds a texture name, whether a real one or an alias, and where to grab it from.
addTextureSourceName( "myRT", 0, TextureDefinitionBase::TEXTURE_INPUT );
You're assigning an alias named "myRT" to channel Input #0 For local or global textures, the index parameter documentation
fullName | The name of the texture. Names are usually valid only throughout this node. We need the name, not its hash because we need to validate the global_ prefix is used correctly. |
index | Index in the container where the texture is located, eg. this->mLocalTextureDefs[index] for local textures, workspace->mLocalTextureDefs[index] for global textures, and this->mInTextures[index] for input channels. |
textureSource | Source where the index must be used (eg. TEXTURE_LOCAL means mLocalTextureDefs) |
Reimplemented in Ogre::CompositorShadowNodeDef.
void Ogre::CompositorWorkspaceDef::clearAll | ( | void | ) |
Clears everything: All node aliases, and their connections (including output connection).
void Ogre::CompositorWorkspaceDef::clearAllInterNodeConnections | ( | void | ) |
Clears all the connection between channels of the nodes (.
void Ogre::CompositorWorkspaceDef::clearOutputConnections | ( | void | ) |
Clears the connection from the "final output RenderTarget" (i.e.
usually the RenderWindow) that goes to the input channel of one of our nodes. connectOutput.
void Ogre::CompositorWorkspaceDef::connect | ( | IdString | outNode, |
uint32 | outChannel, | ||
IdString | inNode, | ||
uint32 | inChannel | ||
) |
Connects outNode's output channel to inNode's input channel.
Connects all outputs channels from outNode to all input channels from inNode.
If the number of channels don't match, only the first N channels are set (where N is the minimum between outNode's output channels and inNode's input channels).
void Ogre::CompositorWorkspaceDef::connectBuffer | ( | IdString | outNode, |
uint32 | outChannel, | ||
IdString | inNode, | ||
uint32 | inChannel | ||
) |
Connects outNode's output buffer channel to inNode's input buffer channel.
Connects all output buffer channels from outNode to all input buffer channels from inNode.
If the number of channels don't match, only the first N channels are set (where N is the minimum between outNode's output channels and inNode's input channels).
void Ogre::CompositorWorkspaceDef::connectExternal | ( | uint32 | externalIdx, |
IdString | inNode, | ||
uint32 | inChannel | ||
) |
Connects the (probably "final") node by passing the RenderWindow in the given input channel.
void Ogre::CompositorWorkspaceDef::connectExternalBuffer | ( | uint32 | externalBufferIdx, |
IdString | inNode, | ||
uint32 | inChannel | ||
) |
Connects an external buffer to the given input channel.
|
staticinherited |
|
staticinherited |
Utility function to create the buffers based on a given set of buffer definitions and put them in a container.
|
staticinherited |
|
staticinherited |
Utility function to create the textures based on a given set of texture definitions and put them in a container.
textureDefs | Array of texture definitions |
inOutTexContainer | Where we'll store the newly created RTs & textures |
id | Unique id in the case we want textures to have unique names (uniqueNames must be true) |
uniqueNames | Set to true if each RT will have a unique name based on given Id, or we don't. The latter is useful for global textures (let them get access through materials) |
finalTarget | The final render target (usually the render window) we have to clone parameters from (eg. when using auto width & height, or fsaa settings) |
renderSys | The RenderSystem to use |
|
staticinherited |
|
staticinherited |
createTextures
|
inline |
|
inlineinherited |
|
inlineinherited |
Returns the local buffer definitions.
|
inlineinherited |
|
inlineinherited |
Returns the local texture definitions.
|
inline |
|
inline |
|
inlineinherited |
|
inline |
Gets read-only access to the map to all added nodes and their aliases.
Useful to know which nodes are in use by this compositor. Use and to safely modify the map.
|
inherited |
|
inherited |
This has O(N) complexity! (not cached, we look in mNameToChannelMap)
|
inherited |
|
inherited |
|
inherited |
Retrieves in which container to look for when looking to which texture is a given name associated with.
name | The name of the texture. Names are usually valid only throughout this node. |
index | [out] The index at the container in which the texture associated with the output channel is stored |
textureSource | [out] Where to get this texture from |
Referenced by Ogre::CompositorNodeDef::getStartEnabled().
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
operator new, with debug line info
|
inlineinherited |
|
inlineinherited |
placement operator new
|
inlineinherited |
array operator new, with debug line info
|
inlineinherited |
|
staticinherited |
Destroys & recreates only the buffers that depend on the main RT (i.e.
the RenderWindow) resolution
textureDefs | Array of texture definitions, so we know which ones depend on main RT's resolution |
inOutTexContainer | Where we'll replace the RTs & textures |
finalTarget | The final render target (usually the render window) we have to clone parameters from (eg. when using auto width & height, or fsaa settings) |
renderSys | The RenderSystem to use |
connectedNodes | Array of connected nodes that may be using our buffers and need to be notified. |
passes | Array of Compositor Passes which may contain the texture being recreated When the pointer is null, we don't iterate through it. |
|
staticinherited |
Destroys & recreates only the textures that depend on the main RT (e.g.
the Render Window) resolution.
textureDefs | Array of texture definitions, so we know which ones depend on main RT's resolution |
inOutTexContainer | Where we'll replace the RTs & textures |
finalTarget | The final render target (usually the render window) we have to clone parameters from (eg. when using auto width & height, or fsaa settings) |
renderSys | The RenderSystem to use |
|
staticinherited |
See recreateResizableTextures01 Updates involved RenderPassDescriptors.
connectedNodes | Array of connected nodes that may be using our textures and need to be notified. |
passes | Array of Compositor Passes which may contain the texture being recreated When the pointer is null, we don't iterate through it. |
|
inherited |
|
virtualinherited |
Remove a buffer. Buffer can come from an input channel, or a locally defined one.
void Ogre::CompositorWorkspaceDef::removeNodeAlias | ( | IdString | alias | ) |
Removes a particular Node.
All of its connections to other node are also removed, which may leave other nodes with its inputs in an incomplete state.
|
inherited |
|
virtualinherited |
WARNING: Be very careful with this function.
Removes a texture. If the texture is from an input channel (TEXTURE_INPUT), the input channel is removed. If the texture is a local definition (TEXTURE_LOCAL) the texture definition is removed and all the references to mLocalTextureDefs[i+1] ... mLocalTextureDefs[i+n] are updated. However, the output channels will now contain an invalid index and will only be removed if it was the last output channel (since we can't alter the order). It is your responsability to call CompositorNodeDef::mapOutputChannel again with a valid texture name to the channel it was occupying. If the texture is a global texture (TEXTURE_GLOBAL), the global texture can no longer be accessed until addTextureSourceName( name, 0, TEXTURE_GLOBAL ) is called again.
name | Name of the texture to remove. |
Reimplemented in Ogre::CompositorNodeDef.
|
inherited |
Changes the name of a buffer.
Buffer can come from an input channel, or a locally defined one.
|
inherited |
Changes the name of a texture.
Texture can come from an input channel, be a global texture, or a locally defined one. You can't rename a global texture to avoid the "global_" prefix, or add the "global_" prefix to a texture that wasn't global.
|
inlineinherited |
Reserves enough memory for all texture definitions.
numPasses | The number of texture definitions expected to contain. |
|
inlineinherited |
Reserves enough memory for all texture definitions.
numPasses | The number of texture definitions expected to contain. |
|
staticinherited |
|
friend |