![]() |
Murl Engine API
Version 2018.3
|
The IUniformContainer property interface. More...
#include <murl_graph_i_uniform_container.h>
The IUniformContainer property interface.
This interface provides a common way to store and retrieve individual shader uniform variables of different types, usually found in nodes implementing e.g. the Graph::IGenericParameters interface.
Public Member Functions | |
virtual SInt32 | AddUniform (IEnums::UniformItem item, IEnums::UniformType type, UInt32 &byteOffset)=0 |
Add a predefined shader uniform variable. More... | |
virtual SInt32 | AddUniform (const String &name, IEnums::UniformType type, UInt32 &byteOffset)=0 |
Add a user-defined shader uniform variable. More... | |
virtual SInt32 | GetUniformIndex (IEnums::UniformItem item) const =0 |
Query the location of a predefined uniform variable in the container. More... | |
virtual SInt32 | GetUniformIndex (const String &name) const =0 |
Query the location of a user-defined uniform variable in the container. More... | |
virtual UInt32 | GetNumberOfUniforms () const =0 |
Get the total number of individual uniform variables in the container. More... | |
virtual IEnums::UniformType | GetUniformType (UInt32 index) const =0 |
Query the type of a uniform variable at a given index. More... | |
virtual IEnums::UniformItem | GetUniformItem (UInt32 index) const =0 |
Query the predefined item of a uniform variable at a given index. More... | |
virtual const String & | GetUniformName (UInt32 index) const =0 |
Query the variable name of a uniform at a given index. More... | |
virtual UInt32 | GetUniformByteOffset (UInt32 index) const =0 |
Get the byte offset of a uniform at a given index. More... | |
virtual IUniform * | GetUniform (UInt32 index) const =0 |
Get the uniform object at a given index. More... | |
virtual IFloatUniform * | GetFloatUniform (UInt32 index) const =0 |
Get the attribute at a given index as a scalar 32bit floating point object. More... | |
virtual IFloatVector2Uniform * | GetFloatVector2Uniform (UInt32 index) const =0 |
Get the uniform at a given index as a 2-component 32bit floating point vector object. More... | |
virtual IFloatVector3Uniform * | GetFloatVector3Uniform (UInt32 index) const =0 |
Get the uniform at a given index as a 3-component 32bit floating point vector object. More... | |
virtual IFloatVector4Uniform * | GetFloatVector4Uniform (UInt32 index) const =0 |
Get the uniform at a given index as a 4-component 32bit floating point vector object. More... | |
virtual IFloatMatrix2Uniform * | GetFloatMatrix2Uniform (UInt32 index) const =0 |
Get the uniform at a given index as a 2x2-component 32bit floating point matrix object. More... | |
virtual IFloatMatrix3Uniform * | GetFloatMatrix3Uniform (UInt32 index) const =0 |
Get the uniform at a given index as a 3x3-component 32bit floating point matrix object. More... | |
virtual IFloatMatrix4Uniform * | GetFloatMatrix4Uniform (UInt32 index) const =0 |
Get the uniform at a given index as a 4x4-component 32bit floating point matrix object. More... | |
virtual ISInt32Uniform * | GetSInt32Uniform (UInt32 index) const =0 |
Get the attribute at a given index as a scalar 32bit signed integer object. More... | |
virtual ISInt32Vector2Uniform * | GetSInt32Vector2Uniform (UInt32 index) const =0 |
Get the uniform at a given index as a 2-component 32bit signed integer vector object. More... | |
virtual ISInt32Vector3Uniform * | GetSInt32Vector3Uniform (UInt32 index) const =0 |
Get the uniform at a given index as a 3-component 32bit signed integer vector object. More... | |
virtual ISInt32Vector4Uniform * | GetSInt32Vector4Uniform (UInt32 index) const =0 |
Get the uniform at a given index as a 4-component 32bit signed integer vector object. More... | |
|
pure virtual |
Add a predefined shader uniform variable.
This method adds a predefined shader uniform variable to the container, with a given uniform type. If successful, this method returns the zero-based index of the newly created uniform in the container; if failed, -1 is returned.
item | The predefined uniform item to add. |
type | The uniform's data type. |
byteOffset | The byte offset of the uniform location relative to its container data start. |
|
pure virtual |
Add a user-defined shader uniform variable.
This method adds a user-defined shader uniform variable to the container, with a given uniform type. The newly created uniform variable is only in effect when a shader material is currently active that actually uses a uniform variable with the given name in its vertex and/or fragment shader. If successful, this method returns the zero-based index of the newly created uniform in the container; if failed, -1 is returned.
name | The name of the uniform variable to add. |
type | The uniform's data type. |
byteOffset | The byte offset of the uniform location relative to its container data start. |
|
pure virtual |
Query the location of a predefined uniform variable in the container.
This method can be used to query the zero-based index of a given predefined uniform in the container. If the container does not hold the given uniform, -1 is returned.
item | The predefined uniform to query. |
|
pure virtual |
Query the location of a user-defined uniform variable in the container.
This method can be used to query the zero-based index of a given user-defined uniform in the container. If the container does not hold the given uniform, -1 is returned.
name | The name of the user-defined uniform to query. |
|
pure virtual |
Get the total number of individual uniform variables in the container.
|
pure virtual |
Query the type of a uniform variable at a given index.
index | The zero-based index of the uniform to query. |
|
pure virtual |
Query the predefined item of a uniform variable at a given index.
If the uniform at the given index represents a predefined one, this method returns the actual item, e.g. IEnums::UNIFORM_ITEM_MATERIAL_COLOR_DIFFUSE. If the attribute is a user-defined one, it returns IEnums::UNIFORM_ITEM_CUSTOM.
index | The zero-based index of the uniform to query. |
|
pure virtual |
Query the variable name of a uniform at a given index.
If the uniform at the given index represents a user-defined one, this method returns its actual name string. If it is a predefined one, an empty string is returned.
index | The zero-based index of the uniform to query. |
|
pure virtual |
Get the byte offset of a uniform at a given index.
index | The zero-based index of the uniform to query. |
Get the uniform object at a given index.
This method returns an actual uniform object by its Graph::IUniform base interface. The base interface can be used to query common uniform properties; if access to actual uniform data is required, use either a dynamic_cast to one of the available specialized interfaces (e.g. Graph::IFloatMatrix4Uniform), or use the respective explicit method, e.g. GetFloatMatrix4Uniform().
index | The zero-based index of the uniform to retrieve. |
|
pure virtual |
Get the attribute at a given index as a scalar 32bit floating point object.
This method can be used as a convenience to retrieve a typed uniform object. If the uniform present in the container at the given index does not match the requested type (scalar float in this case), a null pointer is returned.
index | The zero-based index of the uniform to retrieve. |
|
pure virtual |
Get the uniform at a given index as a 2-component 32bit floating point vector object.
See GetFloatUniform().
index | The zero-based index of the uniform to retrieve. |
|
pure virtual |
Get the uniform at a given index as a 3-component 32bit floating point vector object.
See GetFloatUniform().
index | The zero-based index of the uniform to retrieve. |
|
pure virtual |
Get the uniform at a given index as a 4-component 32bit floating point vector object.
See GetFloatUniform().
index | The zero-based index of the uniform to retrieve. |
|
pure virtual |
Get the uniform at a given index as a 2x2-component 32bit floating point matrix object.
See GetFloatUniform().
index | The zero-based index of the uniform to retrieve. |
|
pure virtual |
Get the uniform at a given index as a 3x3-component 32bit floating point matrix object.
See GetFloatUniform().
index | The zero-based index of the uniform to retrieve. |
|
pure virtual |
Get the uniform at a given index as a 4x4-component 32bit floating point matrix object.
See GetFloatUniform().
index | The zero-based index of the uniform to retrieve. |
|
pure virtual |
Get the attribute at a given index as a scalar 32bit signed integer object.
See GetFloatUniform().
index | The zero-based index of the uniform to retrieve. |
|
pure virtual |
Get the uniform at a given index as a 2-component 32bit signed integer vector object.
See GetFloatUniform().
index | The zero-based index of the uniform to retrieve. |
|
pure virtual |
Get the uniform at a given index as a 3-component 32bit signed integer vector object.
See GetFloatUniform().
index | The zero-based index of the uniform to retrieve. |
|
pure virtual |
Get the uniform at a given index as a 4-component 32bit signed integer vector object.
See GetFloatUniform().
index | The zero-based index of the uniform to retrieve. |