The IUniformContainer property interface. More...
#include "murl_graph_i_uniform_container.h"
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... | |
Detailed Description
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.
Member Function Documentation
◆ AddUniform() [1/2]
|
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.
- Parameters
-
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.
- Returns
- The zero-based index of the uniform in the container, or -1 if failed.
◆ AddUniform() [2/2]
|
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.
- Parameters
-
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.
- Returns
- The zero-based index of the uniform in the container, or -1 if failed.
◆ GetUniformIndex() [1/2]
|
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.
- Parameters
-
item The predefined uniform to query.
- Returns
- The zero-based index of the uniform, or -1 if not found.
◆ GetUniformIndex() [2/2]
|
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.
- Parameters
-
name The name of the user-defined uniform to query.
- Returns
- The zero-based index of the uniform, or -1 if not found.
◆ GetNumberOfUniforms()
|
pure virtual |
Get the total number of individual uniform variables in the container.
- Returns
- The total number of uniform added.
◆ GetUniformType()
|
pure virtual |
Query the type of a uniform variable at a given index.
- Parameters
-
index The zero-based index of the uniform to query.
- Returns
- The uniform type.
◆ GetUniformItem()
|
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.
- Parameters
-
index The zero-based index of the uniform to query.
- Returns
- The predefined uniform item.
◆ GetUniformName()
|
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.
- Parameters
-
index The zero-based index of the uniform to query.
- Returns
- The user-defined uniform variable name.
◆ GetUniformByteOffset()
|
pure virtual |
Get the byte offset of a uniform at a given index.
- Parameters
-
index The zero-based index of the uniform to query.
- Returns
- The uniform's byte offset relative to the beginning of its container data.
◆ GetUniform()
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().
- Parameters
-
index The zero-based index of the uniform to retrieve.
- Returns
- The uniform object.
◆ GetFloatUniform()
|
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.
- Parameters
-
index The zero-based index of the uniform to retrieve.
- Returns
- The uniform object, or a null pointer if the types do not match.
◆ GetFloatVector2Uniform()
|
pure virtual |
Get the uniform at a given index as a 2-component 32bit floating point vector object.
See GetFloatUniform().
- Parameters
-
index The zero-based index of the uniform to retrieve.
- Returns
- The uniform object, or a null pointer if the types do not match.
◆ GetFloatVector3Uniform()
|
pure virtual |
Get the uniform at a given index as a 3-component 32bit floating point vector object.
See GetFloatUniform().
- Parameters
-
index The zero-based index of the uniform to retrieve.
- Returns
- The uniform object, or a null pointer if the types do not match.
◆ GetFloatVector4Uniform()
|
pure virtual |
Get the uniform at a given index as a 4-component 32bit floating point vector object.
See GetFloatUniform().
- Parameters
-
index The zero-based index of the uniform to retrieve.
- Returns
- The uniform object, or a null pointer if the types do not match.
◆ GetFloatMatrix2Uniform()
|
pure virtual |
Get the uniform at a given index as a 2x2-component 32bit floating point matrix object.
See GetFloatUniform().
- Parameters
-
index The zero-based index of the uniform to retrieve.
- Returns
- The uniform object, or a null pointer if the types do not match.
◆ GetFloatMatrix3Uniform()
|
pure virtual |
Get the uniform at a given index as a 3x3-component 32bit floating point matrix object.
See GetFloatUniform().
- Parameters
-
index The zero-based index of the uniform to retrieve.
- Returns
- The uniform object, or a null pointer if the types do not match.
◆ GetFloatMatrix4Uniform()
|
pure virtual |
Get the uniform at a given index as a 4x4-component 32bit floating point matrix object.
See GetFloatUniform().
- Parameters
-
index The zero-based index of the uniform to retrieve.
- Returns
- The uniform object, or a null pointer if the types do not match.
◆ GetSInt32Uniform()
|
pure virtual |
Get the attribute at a given index as a scalar 32bit signed integer object.
See GetFloatUniform().
- Parameters
-
index The zero-based index of the uniform to retrieve.
- Returns
- The uniform object, or a null pointer if the types do not match.
◆ GetSInt32Vector2Uniform()
|
pure virtual |
Get the uniform at a given index as a 2-component 32bit signed integer vector object.
See GetFloatUniform().
- Parameters
-
index The zero-based index of the uniform to retrieve.
- Returns
- The uniform object, or a null pointer if the types do not match.
◆ GetSInt32Vector3Uniform()
|
pure virtual |
Get the uniform at a given index as a 3-component 32bit signed integer vector object.
See GetFloatUniform().
- Parameters
-
index The zero-based index of the uniform to retrieve.
- Returns
- The uniform object, or a null pointer if the types do not match.
◆ GetSInt32Vector4Uniform()
|
pure virtual |
Get the uniform at a given index as a 4-component 32bit signed integer vector object.
See GetFloatUniform().
- Parameters
-
index The zero-based index of the uniform to retrieve.
- Returns
- The uniform object, or a null pointer if the types do not match.
The documentation for this interface was generated from the following file:
- murl_graph_i_uniform_container.h