Om
1.0.0
A universal framework for multimedia simulation
|
A class that represents a kind of visual effect that uses an ordered series of techniquees. More...
#include <omGraphicsTechnique.h>
Public Member Functions | |
Technique () | |
Create a new material technique with no techniquees. More... | |
Technique (const TechniqueUsage &newUsage) | |
Create a new material technique with no techniquees or name and the specified usage. More... | |
const TechniqueUsage & | getUsage () const |
Return an enum value indicating the semantic usage of this material technique. More... | |
void | setUsage (const TechniqueUsage &newUsage) |
Set an enum value indicating the semantic usage of this material technique. More... | |
RenderPass & | getPasses () |
Return a flags object indicating the rendering passes this technique can be used for. More... | |
const RenderPass & | getPasses () const |
Return a flags object indicating the rendering passes this technique can be used for. More... | |
void | setPasses (const RenderPass &newRenderPasses) |
Set a flags object indicating the rendering passes this technique can be used for. More... | |
ShaderProgram * | getProgram () const |
Return a pointer to the shader program that should be used to render this technique. More... | |
void | setProgram (ShaderProgram *newProgram) |
Return a pointer to the shader program that should be used to render this technique. More... | |
ShaderConfiguration & | getConfiguration () |
Return a reference to the object that stores the compile-time configuration of this technique. More... | |
const ShaderConfiguration & | getConfiguration () const |
Return a const reference to the object that stores the compile-time configuration of this technique. More... | |
void | setConfiguration (const ShaderConfiguration &newConfiguration) |
Set the object that stores the compile-time configuration of this technique. More... | |
RenderMode & | getRenderMode () |
Return the current render mode for this technique. More... | |
const RenderMode & | getRenderMode () const |
Return the current render mode for this technique. More... | |
void | setRenderMode (const RenderMode &newRenderMode) |
Set the current render mode for this technique. More... | |
const ShaderBindingSet & | getBindings () const |
Return a reference to the object that stores the renderable bindings for this technique. More... | |
Size | getConstantCount () const |
Return the number of constant bindings associated with this technique. More... | |
const ConstantBinding & | getConstantBinding (Index constantIndex) const |
Return a reference to the ConstantBinding at the specified index in this technique. More... | |
Bool | getConstantIndex (const ShaderSourceString &constantName, Index &constantIndex) const |
Get the index of the binding for the constant variable with the specified name. More... | |
Bool | getConstantIndex (const ConstantUsage &usage, Index &constantIndex) const |
Get the index of the first constant binding in the binding set that has the specified constant usage. More... | |
Bool | getConstant (Index constantIndex, AttributeValue &value, Index arrayIndex=Index(0)) const |
Get the constant value for this technique at the specified index and array index. More... | |
Bool | setConstant (Index constantIndex, const AttributeValue &value, Index arrayIndex=Index(0)) |
Set the constant value for this technique at the specified index and array index, replacing any previous value. More... | |
Bool | getConstant (ConstantUsage::Enum usage, AttributeValue &value, Index arrayIndex=Index(0)) const |
Get the constant value for this shader binding set with the given usage and array index. More... | |
Bool | setConstant (ConstantUsage::Enum usage, const AttributeValue &value, Index arrayIndex=Index(0)) |
Set the constant value for this shader binding set with the given usage and array index, replacing any previous value. More... | |
Bool | getConstant (const ConstantUsage &usage, AttributeValue &value, Index arrayIndex=Index(0)) const |
Get the constant value for this shader binding set with the given usage and array index. More... | |
Bool | setConstant (const ConstantUsage &usage, const AttributeValue &value, Index arrayIndex=Index(0)) |
Set the constant value for this shader binding set with the given usage and array index, replacing any previous value. More... | |
ConstantUsage | getConstantUsage (Index constantIndex) const |
Return an object indicating the usage of the constant in this technique at the given index. More... | |
Bool | setConstantUsage (Index constantIndex, const ConstantUsage &newUsage) |
Set the usage of the constant in this technique at the given index. More... | |
ShaderBindingFlags | getConstantFlags (Index constantIndex) const |
Return an object indicating the flags of the constant in this technique at the given index. More... | |
Bool | setConstantFlags (Index constantIndex, const ShaderBindingFlags &newFlags) |
Set the flags of the constant in this technique at the given index. More... | |
Size | getTextureCount () const |
Get the number of texture bindings associated with this technique. More... | |
const TextureBinding & | getTextureBinding (Index textureIndex) const |
Return a reference to the TextureBinding at the specified index in this shader pas. More... | |
Bool | getTextureIndex (const ShaderSourceString &variableName, Index &textureIndex) const |
Get the index of the binding for the texture variable with the specified name. More... | |
Bool | getTextureIndex (TextureUsage::Enum usage, Index &textureIndex) const |
Get the index of the first texture binding in the binding set that has the specified texture usage. More... | |
Bool | getTextureIndex (const TextureUsage &usage, Index &textureIndex) const |
Get the index of the first texture binding in the binding set that has the specified texture usage. More... | |
Texture * | getTexture (Index textureIndex, Index arrayIndex=Index(0)) const |
Get the texture in this technique at the specified binding and array index. More... | |
Bool | setTexture (Index textureIndex, Texture *texture, Index arrayIndex=Index(0)) |
Set the texture in this technique at the specified binding and array index, replacing any previous texture. More... | |
Texture * | getTexture (TextureUsage::Enum usage, Index arrayIndex=Index(0)) const |
Get the texture for this shader binding set with the given usage and array index. More... | |
Bool | setTexture (TextureUsage::Enum usage, Texture *texture, Index arrayIndex=Index(0)) |
Set the texture for this shader binding set with the given usage and array index, replacing any previous texture. More... | |
Texture * | getTexture (const TextureUsage &usage, Index arrayIndex=Index(0)) const |
Get the texture for this shader binding set with the given usage and array index. More... | |
Bool | setTexture (const TextureUsage &usage, Texture *texture, Index arrayIndex=Index(0)) |
Set the texture for this shader binding set with the given usage and array index, replacing any previous texture. More... | |
TextureUsage | getTextureUsage (Index textureIndex) const |
Return an object indicating the usage of the texture in this technique at the given index. More... | |
Bool | setTextureUsage (Index textureIndex, const TextureUsage &newUsage) |
Set the usage of the texture in this technique at the given index. More... | |
ShaderBindingFlags | getTextureFlags (Index textureIndex) const |
Return an object indicating the flags of the texture in this technique at the given index. More... | |
Bool | setTextureFlags (Index textureIndex, const ShaderBindingFlags &newFlags) |
Set the flags of the texture in this technique at the given index. More... | |
Size | getVertexBufferCount () const |
Get the number of vertex bindings associated with this technique. More... | |
const VertexBinding & | getVertexBinding (Index bindingIndex) const |
Return a reference to the VertexBinding at the specified index in this shader pas. More... | |
Bool | getVertexBufferIndex (const ShaderSourceString &variableName, Index &bindingIndex) const |
Get the index of the binding for the vertex variable with the specified name. More... | |
Bool | getVertexBufferIndex (VertexUsage::Enum usage, Index &bindingIndex) const |
Get the index of the first vertex binding in the binding set that has the specified vertex usage. More... | |
Bool | getVertexBufferIndex (const VertexUsage &usage, Index &bindingIndex) const |
Get the index of the first vertex binding in the binding set that has the specified vertex usage. More... | |
VertexBuffer * | getVertexBuffer (Index bindingIndex, Index arrayIndex=Index(0)) const |
Get the vertex buffer in this technique at the specified binding and array index. More... | |
Bool | setVertexBuffer (Index bindingIndex, VertexBuffer *buffer, Index arrayIndex=Index(0)) |
Set the vertex buffer in this technique at the specified binding and array index, replacing any previous buffer. More... | |
VertexBuffer * | getVertexBuffer (VertexUsage::Enum usage, Index arrayIndex=Index(0)) const |
Get the vertex buffer for this shader binding set with the given usage and array index. More... | |
Bool | setVertexBuffer (VertexUsage::Enum usage, VertexBuffer *buffer, Index arrayIndex=Index(0)) |
Set the vertex buffer for this shader binding set with the given usage and array index, replacing any previous buffer. More... | |
VertexBuffer * | getVertexBuffer (const VertexUsage &usage, Index arrayIndex=Index(0)) const |
Get the vertex buffer for this shader binding set with the given usage and array index. More... | |
Bool | setVertexBuffer (const VertexUsage &usage, VertexBuffer *buffer, Index arrayIndex=Index(0)) |
Set the vertex buffer for this shader binding set with the given usage and array index, replacing any previous buffer. More... | |
VertexUsage | getVertexBufferUsage (Index bindingIndex) const |
Return an object indicating the usage of the vertex buffer in this technique at the given index. More... | |
Bool | setVertexBufferUsage (Index bindingIndex, const VertexUsage &newUsage) |
Set the usage of the vertex buffer in this technique at the given index. More... | |
ShaderBindingFlags | getVertexBufferFlags (Index textureIndex) const |
Return an object indicating the flags of the vertex binding in this technique at the given index. More... | |
Bool | setVertexBufferFlags (Index textureIndex, const ShaderBindingFlags &newFlags) |
Set the flags of the vertex binding in this technique at the given index. More... | |
Bool | isTransparent () const |
Return whether or not this technique produces pixels that are transparent. More... | |
virtual void | setContext (devices::GraphicsContext *newContext) |
Prepare this technique and its techniquees for rendering with the specified context. More... | |
virtual void | upload (UploadRequest &request) |
Upload this technique and its shaders' current CPU representation to the GPU device. More... | |
virtual void | download (DownloadRequest &request) |
Download the technique and its shaders' GPU representation to CPU memory. More... | |
virtual Bool | isUploaded () const |
Return whether or not this technique has been successfully created and uploaded to the device. More... | |
virtual Bool | isDownloaded () const |
Return whether or not this technique has a copy of its data stored in CPU-side memory. More... | |
virtual Bool | isValid () const |
Return whether or not the state of this technique is valid (either on CPU or GPU) and able to be used for rendering. More... | |
const DeviceShaderProgram * | getRenderable () const |
Return a pointer to the context-renderable shader program for this technique, or NULL if there is none. More... | |
Public Member Functions inherited from om::graphics::devices::GraphicsContextObject | |
virtual | ~GraphicsContextObject () |
Destory this graphics context object. More... | |
GraphicsContext * | getContext () const |
Return a pointer to the graphics context this context object is using to do rendering. More... | |
void | clearContext () |
Clear the previous context from this object. More... | |
void | upload () |
Upload this resource's CPU representation to the GPU device. More... | |
void | download () |
Upload this resource's CPU representation to the GPU device. More... | |
Static Public Attributes | |
static const ResourceType | RESOURCE_TYPE |
The resource type for a graphics technique. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from om::graphics::devices::GraphicsContextObject | |
GraphicsContextObject () | |
Create a new graphics context object that doesn't have an associated graphics context. More... | |
GraphicsContextObject (GraphicsContext *newContext) | |
Create a new graphics context object that uses the specified context for rendering. More... | |
Protected Attributes inherited from om::graphics::devices::GraphicsContextObject | |
GraphicsContext * | context |
A pointer to the graphics context this object is using. More... | |
A class that represents a kind of visual effect that uses an ordered series of techniquees.
A material technique contains an ordered list of techniquees which indicate the different passes that are part of rendering a particular visual effect. These passes are performed in series during rendering in the order stored in the technique.
A material technique may be simply a different visual style (shiny or not shiny) or a totally different rendering technique (standard versus shadow map rendering).
om::graphics::materials::Technique::Technique | ( | ) |
Create a new material technique with no techniquees.
om::graphics::materials::Technique::Technique | ( | const TechniqueUsage & | newUsage | ) |
Create a new material technique with no techniquees or name and the specified usage.
|
inline |
Return an enum value indicating the semantic usage of this material technique.
|
inline |
Set an enum value indicating the semantic usage of this material technique.
|
inline |
Return a flags object indicating the rendering passes this technique can be used for.
|
inline |
Return a flags object indicating the rendering passes this technique can be used for.
|
inline |
Set a flags object indicating the rendering passes this technique can be used for.
|
inline |
Return a pointer to the shader program that should be used to render this technique.
|
inline |
Return a pointer to the shader program that should be used to render this technique.
|
inline |
Return a reference to the object that stores the compile-time configuration of this technique.
|
inline |
Return a const reference to the object that stores the compile-time configuration of this technique.
|
inline |
Set the object that stores the compile-time configuration of this technique.
|
inline |
Return the current render mode for this technique.
|
inline |
Return the current render mode for this technique.
|
inline |
Set the current render mode for this technique.
|
inline |
Return a reference to the object that stores the renderable bindings for this technique.
The bindings in this set correspond directly to the variables that are in the current device shader program for this technique. If there is no valid shader program, the binding set will be empty.
|
inline |
Return the number of constant bindings associated with this technique.
|
inline |
Return a reference to the ConstantBinding at the specified index in this technique.
Binding indices range from 0 to the number of bindings minus one.
|
inline |
Get the index of the binding for the constant variable with the specified name.
This method finds the binding with the specified name and places its index in the output reference parameter if the binding was found.
The method returns whether or not there was a binding for a constant with that name.
|
inline |
Get the index of the first constant binding in the binding set that has the specified constant usage.
|
inline |
Get the constant value for this technique at the specified index and array index.
The method returns whether or not the constant at that index and array index was able to be accessed. The constant value is stored in the output value parameter.
|
inline |
Set the constant value for this technique at the specified index and array index, replacing any previous value.
The method returns whether or not the constant at that index and array index was able to be changed.
|
inline |
Get the constant value for this shader binding set with the given usage and array index.
The method returns whether or not the constant with that usage and array index was able to be accessed. The constant value is stored in the output value parameter.
|
inline |
Set the constant value for this shader binding set with the given usage and array index, replacing any previous value.
The method returns whether or not the constant with that usage and array index was able to be changed.
|
inline |
Get the constant value for this shader binding set with the given usage and array index.
The method returns whether or not the constant with that usage and array index was able to be accessed. The constant value is stored in the output value parameter.
|
inline |
Set the constant value for this shader binding set with the given usage and array index, replacing any previous value.
The method returns whether or not the constant with that usage and array index was able to be changed.
|
inline |
Return an object indicating the usage of the constant in this technique at the given index.
|
inline |
Set the usage of the constant in this technique at the given index.
The method returns whether or not the constant's usage was able to be modified.
|
inline |
Return an object indicating the flags of the constant in this technique at the given index.
|
inline |
Set the flags of the constant in this technique at the given index.
The method returns whether or not the constant's flags were able to be modified.
|
inline |
Get the number of texture bindings associated with this technique.
|
inline |
Return a reference to the TextureBinding at the specified index in this shader pas.
Binding indices range from 0 to the number of bindings minus one.
|
inline |
Get the index of the binding for the texture variable with the specified name.
This method finds the binding with the specified name and places its index in the output reference parameter if the binding was found.
The method returns whether or not there was a binding for a texture with that name.
|
inline |
Get the index of the first texture binding in the binding set that has the specified texture usage.
|
inline |
Get the index of the first texture binding in the binding set that has the specified texture usage.
|
inline |
Get the texture in this technique at the specified binding and array index.
|
inline |
Set the texture in this technique at the specified binding and array index, replacing any previous texture.
|
inline |
Get the texture for this shader binding set with the given usage and array index.
|
inline |
Set the texture for this shader binding set with the given usage and array index, replacing any previous texture.
|
inline |
Get the texture for this shader binding set with the given usage and array index.
|
inline |
Set the texture for this shader binding set with the given usage and array index, replacing any previous texture.
|
inline |
Return an object indicating the usage of the texture in this technique at the given index.
|
inline |
Set the usage of the texture in this technique at the given index.
The method returns whether or not the texture's usage was able to be modified.
|
inline |
Return an object indicating the flags of the texture in this technique at the given index.
|
inline |
Set the flags of the texture in this technique at the given index.
The method returns whether or not the texture's flags were able to be modified.
|
inline |
Get the number of vertex bindings associated with this technique.
|
inline |
Return a reference to the VertexBinding at the specified index in this shader pas.
Binding indices range from 0 to the number of bindings minus one.
|
inline |
Get the index of the binding for the vertex variable with the specified name.
This method finds the binding with the specified name and places its index in the output reference parameter if the binding was found.
The method returns whether or not there was a binding for a vertex buffer with that name.
|
inline |
Get the index of the first vertex binding in the binding set that has the specified vertex usage.
|
inline |
Get the index of the first vertex binding in the binding set that has the specified vertex usage.
|
inline |
Get the vertex buffer in this technique at the specified binding and array index.
|
inline |
Set the vertex buffer in this technique at the specified binding and array index, replacing any previous buffer.
The method returns whether or not the vertex buffer at that index and array index was able to be changed.
|
inline |
Get the vertex buffer for this shader binding set with the given usage and array index.
|
inline |
Set the vertex buffer for this shader binding set with the given usage and array index, replacing any previous buffer.
The method returns whether or not the vertex buffer with that usage and array index was able to be changed.
|
inline |
Get the vertex buffer for this shader binding set with the given usage and array index.
|
inline |
Set the vertex buffer for this shader binding set with the given usage and array index, replacing any previous buffer.
The method returns whether or not the vertex buffer with that usage and array index was able to be changed.
|
inline |
Return an object indicating the usage of the vertex buffer in this technique at the given index.
|
inline |
Set the usage of the vertex buffer in this technique at the given index.
The method returns whether or not the vertex buffer's usage was able to be modified.
|
inline |
Return an object indicating the flags of the vertex binding in this technique at the given index.
|
inline |
Set the flags of the vertex binding in this technique at the given index.
The method returns whether or not the vertex binding's flags were able to be modified.
|
inline |
Return whether or not this technique produces pixels that are transparent.
A technique is deemed to be transparent if blending and transparency depth sorting is enabled by the technique's render mode.
|
virtual |
Prepare this technique and its techniquees for rendering with the specified context.
The method propagates the context to the technique's techniquees and regenerates any context-specific data for the new context if the upload flag is TRUE. The method returns whether or not the context can be successfully used for rendering this material technique.
Reimplemented from om::graphics::devices::GraphicsContextObject.
|
virtual |
Upload this technique and its shaders' current CPU representation to the GPU device.
Reimplemented from om::graphics::devices::GraphicsContextObject.
|
virtual |
Download the technique and its shaders' GPU representation to CPU memory.
Reimplemented from om::graphics::devices::GraphicsContextObject.
|
virtual |
Return whether or not this technique has been successfully created and uploaded to the device.
Reimplemented from om::graphics::devices::GraphicsContextObject.
|
virtual |
Return whether or not this technique has a copy of its data stored in CPU-side memory.
Reimplemented from om::graphics::devices::GraphicsContextObject.
|
virtual |
Return whether or not the state of this technique is valid (either on CPU or GPU) and able to be used for rendering.
Reimplemented from om::graphics::devices::GraphicsContextObject.
|
inline |
Return a pointer to the context-renderable shader program for this technique, or NULL if there is none.
If the technique has a valid context and the shader program has been compiled successfully, the method returns a pointer to the GPU shader program instance for this technique object.
Otherwise, the technique is not renderable and NULL is returned.
|
static |
The resource type for a graphics technique.