![]() |
Murl Engine Lua Addon API
Version 1.0 beta
|
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.
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.
Integer, Integer AddUniform(Murl.IEnums.UniformItem item, Murl.IEnums.UniformType type, Integer byteOffset)
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. |
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.
Integer, Integer AddUniform(String name, Murl.IEnums.UniformType type, Integer byteOffset)
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. |
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.
Integer GetUniformIndex(Murl.IEnums.UniformItem item)
item | The predefined uniform to query. |
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.
Integer GetUniformIndex(String name)
name | The name of the user-defined uniform to query. |
Get the total number of individual uniform variables in the container.
Integer GetNumberOfUniforms()
Query the type of a uniform variable at a given index.
Murl.IEnums.UniformType GetUniformType(Integer index)
index | The zero-based index of the uniform to query. |
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.
Murl.IEnums.UniformItem GetUniformItem(Integer index)
index | The zero-based index of the uniform to query. |
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.
String GetUniformName(Integer index)
index | The zero-based index of the uniform to query. |
Get the byte offset of a uniform at a given index.
Integer GetUniformByteOffset(Integer 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().
Murl.Graph.IUniform GetUniform(Integer index)
index | The zero-based index of the uniform to retrieve. |
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.
Murl.Graph.IFloatUniform GetFloatUniform(Integer index)
index | The zero-based index of the uniform to retrieve. |
Get the uniform at a given index as a 2-component 32bit floating point vector object. See GetFloatUniform().
Murl.Graph.IFloatVector2Uniform GetFloatVector2Uniform(Integer index)
index | The zero-based index of the uniform to retrieve. |
Get the uniform at a given index as a 3-component 32bit floating point vector object. See GetFloatUniform().
Murl.Graph.IFloatVector3Uniform GetFloatVector3Uniform(Integer index)
index | The zero-based index of the uniform to retrieve. |
Get the uniform at a given index as a 4-component 32bit floating point vector object. See GetFloatUniform().
Murl.Graph.IFloatVector4Uniform GetFloatVector4Uniform(Integer index)
index | The zero-based index of the uniform to retrieve. |
Get the uniform at a given index as a 2x2-component 32bit floating point matrix object. See GetFloatUniform().
Murl.Graph.IFloatMatrix2Uniform GetFloatMatrix2Uniform(Integer index)
index | The zero-based index of the uniform to retrieve. |
Get the uniform at a given index as a 3x3-component 32bit floating point matrix object. See GetFloatUniform().
Murl.Graph.IFloatMatrix3Uniform GetFloatMatrix3Uniform(Integer index)
index | The zero-based index of the uniform to retrieve. |
Get the uniform at a given index as a 4x4-component 32bit floating point matrix object. See GetFloatUniform().
Murl.Graph.IFloatMatrix4Uniform GetFloatMatrix4Uniform(Integer index)
index | The zero-based index of the uniform to retrieve. |
Get the attribute at a given index as a scalar 32bit signed integer object. See GetFloatUniform().
Murl.Graph.ISInt32Uniform GetSInt32Uniform(Integer index)
index | The zero-based index of the uniform to retrieve. |
Get the uniform at a given index as a 2-component 32bit signed integer vector object. See GetFloatUniform().
Murl.Graph.ISInt32Vector2Uniform GetSInt32Vector2Uniform(Integer index)
index | The zero-based index of the uniform to retrieve. |
Get the uniform at a given index as a 3-component 32bit signed integer vector object. See GetFloatUniform().
Murl.Graph.ISInt32Vector3Uniform GetSInt32Vector3Uniform(Integer index)
index | The zero-based index of the uniform to retrieve. |
Get the uniform at a given index as a 4-component 32bit signed integer vector object. See GetFloatUniform().
Murl.Graph.ISInt32Vector4Uniform GetSInt32Vector4Uniform(Integer index)
index | The zero-based index of the uniform to retrieve. |