OGRE-Next
2.3
Object-Oriented Graphics Rendering Engine
|
Shadow Nodes are special nodes (not to be confused with. More...
#include <OgreCompositorShadowNodeDef.h>
Public Types | |
typedef vector< BufferDefinition >::type | BufferDefinitionVec |
typedef vector< PixelFormatGpu >::type | PixelFormatGpuVec |
typedef vector< TextureDefinition >::type | TextureDefinitionVec |
enum | TextureSource { TEXTURE_INPUT , TEXTURE_LOCAL , TEXTURE_GLOBAL , NUM_TEXTURES_SOURCES } |
Public Member Functions | |
CompositorShadowNodeDef (const String &name, CompositorManager2 *compositorManager) | |
virtual | ~CompositorShadowNodeDef () |
virtual void | _validateAndFinish () |
Checks that paremeters are correctly set, and finalizes whatever needs to be done, probably because not enough data was available at the time of creation. More... | |
void | addBufferDefinition (IdString name, size_t numElements, uint32 bytesPerElement, uint32 bindFlags, float widthFactor, float heightFactor) |
Creates an UAV buffer. More... | |
void | addBufferInput (size_t inputChannel, IdString name) override |
Buffers. More... | |
RenderTargetViewDef * | addRenderTextureView (IdString name) |
ShadowTextureDefinition * | addShadowTextureDefinition (size_t lightIdx, size_t split, const String &name, const Vector2 &uvOffset, const Vector2 &uvLength, uint8 arrayIdx) |
Adds a new ShadowTexture definition. More... | |
CompositorTargetDef * | addTargetPass (const String &renderTargetName, uint32 rtIndex=0) |
Adds a new Target pass. More... | |
TextureDefinition * | addTextureDefinition (const String &name) |
Creates a TextureDefinition with a given name, must be unique. More... | |
IdString | addTextureSourceName (const String &name, size_t index, TextureSource textureSource) override |
Overloaded to prevent creating input channels. More... | |
size_t | calculateNumPasses () const |
Calculates the total number of passes in this node. More... | |
CompositorManager2 * | getCompositorManager () const |
const BufferDefinitionVec & | getLocalBufferDefinitions () const |
BufferDefinitionVec & | getLocalBufferDefinitionsNonConst () |
Returns the local buffer definitions. More... | |
const TextureDefinitionVec & | getLocalTextureDefinitions () const |
TextureDefinitionVec & | getLocalTextureDefinitionsNonConst () |
Returns the local texture definitions. More... | |
IdString | getName () const |
String | getNameStr () const |
const NameToChannelMap & | getNameToChannelMap () const |
size_t | getNumInputBufferChannels () const |
size_t | getNumInputChannels () const |
This has O(N) complexity! (not cached, we look in mNameToChannelMap) More... | |
size_t | getNumOutputChannels () const |
Returns the number of output channels. More... | |
size_t | getNumShadowTextureDefinitions () const |
Gets the number of shadow texture definitions in this node. More... | |
size_t | getNumTargetPasses () const |
Gets the number of target passes in this node. More... | |
size_t | getPassNumber (const CompositorPassDef *passDef) const |
Returns the pass # of the given pass definition in this node. More... | |
const RenderTargetViewDef * | getRenderTargetViewDef (IdString name) const |
RenderTargetViewDef * | getRenderTargetViewDefNonConstNoThrow (IdString name) |
const ShadowTextureDefinition * | getShadowTextureDefinition (size_t texIndex) const |
Retrieves a shadow texture definition by its index. More... | |
ShadowTextureDefinition * | getShadowTextureDefinitionNonConst (size_t texIndex) |
bool | getStartEnabled (void) const |
CompositorTargetDef * | getTargetPass (size_t passIndex) |
Retrieves an existing pass by it's given index. More... | |
void | getTextureSource (IdString name, size_t &index, TextureSource &textureSource) const |
See http://www.research.att.com/~bs/bs_faq2.html#overloadderived. More... | |
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 | getTextureSource (size_t outputChannel, size_t &index, TextureSource &textureSource) const |
Retrieves in which container to look for when wanting to know the output texture using the mappings from input/local texture -> output. More... | |
void | mapOutputBufferChannel (size_t outChannel, IdString bufferName) |
Maps the output channel to the given buffer name which can be either a local buffer or a reference to an input channel. More... | |
void | mapOutputChannel (size_t outChannel, IdString textureName) |
Maps the output channel to the given texture name, which can be either a local texture or a reference to an input channel. 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... | |
void | postInitializePassDef (CompositorPassDef *passDef) override |
Called right after we create a pass definition. More... | |
void | removeAllRenderTextureViews () |
virtual void | removeBuffer (IdString name) |
Remove a buffer. Buffer can come from an input channel, or a locally defined one. More... | |
void | removeRenderTextureView (IdString name) |
void | removeTexture (IdString name) override |
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 | setDefaultTechnique (ShadowMapTechniques techn) |
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... | |
void | setNumOutputBufferChannels (size_t numOuts) |
Reserves enough memory for all output channel mappings (efficient allocation, better than using linked lists or other containers with two level of indirections) More... | |
void | setNumOutputChannels (size_t numOuts) |
Reserves enough memory for all output channel mappings (efficient allocation, better than using linked lists or other containers with two level of indirections) More... | |
void | setNumShadowTextureDefinitions (size_t numTex) |
Reserves enough memory for all texture definitions. More... | |
void | setNumTargetPass (size_t numPasses) |
Reserves enough memory for all passes. More... | |
void | setStartEnabled (bool enabled) |
Whether the node should be start as enabled when instantiated. 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) |
@See 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) |
Public Attributes | |
IdString | mCustomIdentifier |
Friends | |
class | CompositorShadowNode |
Shadow Nodes are special nodes (not to be confused with.
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inline |
|
inlinevirtual |
|
virtual |
Checks that paremeters are correctly set, and finalizes whatever needs to be done, probably because not enough data was available at the time of creation.
|
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 |
|
overridevirtual |
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 from Ogre::TextureDefinitionBase.
|
inherited |
ShadowTextureDefinition* Ogre::CompositorShadowNodeDef::addShadowTextureDefinition | ( | size_t | lightIdx, |
size_t | split, | ||
const String & | name, | ||
const Vector2 & | uvOffset, | ||
const Vector2 & | uvLength, | ||
uint8 | arrayIdx | ||
) |
Adds a new ShadowTexture definition.
lightIdx | Nth Closest Light to assign this texture to. Must be unique unless split is different. |
split | Split for the given light. Only valid for CSM/PSSM shadow maps. Must be unique for the same lightIdx. |
name | Name to a declared texture that will hold our shadow map. Must not contain the "global_" prefix. |
uvOffset | Values in range [0; 1] to determine what region of the texture will hold our shadow map (i.e. UV atlas). Use Vector2::ZERO if it covers the entire texture. |
uvLength | Values in range [0; 1] to determine what region of the texture will hold our shadow map (i.e. UV atlas). Use Vector2::UNIT_SCALE if it covers the entire texture. |
arrayIdx | If the texture is an array texture, index to the slice that holds our shadow map. |
|
inherited |
Adds a new Target pass.
renderTargetName | We need the full name, not just the hash; so we can check whether it has the global_ prefix |
rtIndex | The RT to address if it is intended to use with a 3D texture (or a cubemap or a 2D Array) @See CompositorPassDef::mRtIndex. Default: 0 |
|
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. |
|
overridevirtual |
Overloaded to prevent creating input channels.
Reimplemented from Ogre::TextureDefinitionBase.
|
inherited |
Calculates the total number of passes in this node.
|
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 |
@See createTextures
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
Returns the local buffer definitions.
|
inlineinherited |
|
inlineinherited |
Returns the local texture definitions.
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inherited |
|
inherited |
This has O(N) complexity! (not cached, we look in mNameToChannelMap)
|
inlineinherited |
Returns the number of output channels.
|
inline |
Gets the number of shadow texture definitions in this node.
|
inlineinherited |
Gets the number of target passes in this node.
|
inherited |
Returns the pass # of the given pass definition in this node.
This operation is O(N). Useful for debug output.
passDef | The pass definition to look for |
|
inherited |
|
inherited |
|
inline |
Retrieves a shadow texture definition by its index.
|
inline |
|
inlineinherited |
|
inlineinherited |
Retrieves an existing pass by it's given index.
|
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 |
|
inherited |
Retrieves in which container to look for when wanting to know the output texture using the mappings from input/local texture -> output.
outputChannel | [in] The output channel we want to know about |
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 |
|
inherited |
Maps the output channel to the given buffer name which can be either a local buffer or a reference to an input channel.
Global buffers can't be used as output.
outChannel | Output channel # to map |
textureName | Name of the buffer |
|
inherited |
Maps the output channel to the given texture name, which can be either a local texture or a reference to an input channel.
Global textures can't be used as output.
outChannel | Output channel # to map |
textureName | Name of the texture, which can be to a local texture, or an input channel's name. Global textures aren't supported. |
|
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 |
Called right after we create a pass definition.
Derived classes may want to do something with it
passDef | Newly created pass to toy with. |
Reimplemented from Ogre::CompositorNodeDef.
|
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.
|
inherited |
|
overridevirtualinherited |
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 from Ogre::TextureDefinitionBase.
|
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.
|
inline |
|
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. |
|
inlineinherited |
Reserves enough memory for all output channel mappings (efficient allocation, better than using linked lists or other containers with two level of indirections)
numPasses | The number of output buffer channels expected to contain. |
|
inlineinherited |
Reserves enough memory for all output channel mappings (efficient allocation, better than using linked lists or other containers with two level of indirections)
numPasses | The number of output channels expected to contain. |
void Ogre::CompositorShadowNodeDef::setNumShadowTextureDefinitions | ( | size_t | numTex | ) |
Reserves enough memory for all texture definitions.
numTex | The number of shadow textures expected to contain. |
|
inlineinherited |
Reserves enough memory for all passes.
numPasses | The number of passes expected to contain. |
|
inlineinherited |
Whether the node should be start as enabled when instantiated.
|
staticinherited |
|
friend |
|
inherited |