Murl Engine Lua Addon API  Version 1.0 beta
Murl.Graph.IUniformContainer

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.


Table members

Methods


AddUniform(item, type, byteOffset)

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)

Parameters
itemThe predefined uniform item to add.
typeThe uniform's data type.
byteOffsetThe byte offset of the uniform location relative to its container data start.
Returns
Integer The zero-based index of the uniform in the container, or -1 if failed.
Integer byteOffset The byte offset of the uniform location relative to its container data start.

AddUniform(name, type, byteOffset)

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)

Parameters
nameThe name of the uniform variable to add.
typeThe uniform's data type.
byteOffsetThe byte offset of the uniform location relative to its container data start.
Returns
Integer The zero-based index of the uniform in the container, or -1 if failed.
Integer byteOffset The byte offset of the uniform location relative to its container data start.

GetUniformIndex(item)

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)

Parameters
itemThe predefined uniform to query.
Returns
Integer The zero-based index of the uniform, or -1 if not found.

GetUniformIndex(name)

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)

Parameters
nameThe name of the user-defined uniform to query.
Returns
Integer The zero-based index of the uniform, or -1 if not found.

GetNumberOfUniforms()

Get the total number of individual uniform variables in the container.

Integer GetNumberOfUniforms()

Returns
Integer The total number of uniform added.

GetUniformType(index)

Query the type of a uniform variable at a given index.

Murl.IEnums.UniformType GetUniformType(Integer index)

Parameters
indexThe zero-based index of the uniform to query.
Returns
Murl.IEnums.UniformType The uniform type.

GetUniformItem(index)

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)

Parameters
indexThe zero-based index of the uniform to query.
Returns
Murl.IEnums.UniformItem The predefined uniform item.

GetUniformName(index)

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)

Parameters
indexThe zero-based index of the uniform to query.
Returns
String The user-defined uniform variable name.

GetUniformByteOffset(index)

Get the byte offset of a uniform at a given index.

Integer GetUniformByteOffset(Integer index)

Parameters
indexThe zero-based index of the uniform to query.
Returns
Integer The uniform's byte offset relative to the beginning of its container data.

GetUniform(index)

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)

Parameters
indexThe zero-based index of the uniform to retrieve.
Returns
Murl.Graph.IUniform The uniform object.

GetFloatUniform(index)

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)

Parameters
indexThe zero-based index of the uniform to retrieve.
Returns
Murl.Graph.IFloatUniform The uniform object, or a null pointer if the types do not match.

GetFloatVector2Uniform(index)

Get the uniform at a given index as a 2-component 32bit floating point vector object. See GetFloatUniform().

Murl.Graph.IFloatVector2Uniform GetFloatVector2Uniform(Integer index)

Parameters
indexThe zero-based index of the uniform to retrieve.
Returns
Murl.Graph.IFloatVector2Uniform The uniform object, or a null pointer if the types do not match.

GetFloatVector3Uniform(index)

Get the uniform at a given index as a 3-component 32bit floating point vector object. See GetFloatUniform().

Murl.Graph.IFloatVector3Uniform GetFloatVector3Uniform(Integer index)

Parameters
indexThe zero-based index of the uniform to retrieve.
Returns
Murl.Graph.IFloatVector3Uniform The uniform object, or a null pointer if the types do not match.

GetFloatVector4Uniform(index)

Get the uniform at a given index as a 4-component 32bit floating point vector object. See GetFloatUniform().

Murl.Graph.IFloatVector4Uniform GetFloatVector4Uniform(Integer index)

Parameters
indexThe zero-based index of the uniform to retrieve.
Returns
Murl.Graph.IFloatVector4Uniform The uniform object, or a null pointer if the types do not match.

GetFloatMatrix2Uniform(index)

Get the uniform at a given index as a 2x2-component 32bit floating point matrix object. See GetFloatUniform().

Murl.Graph.IFloatMatrix2Uniform GetFloatMatrix2Uniform(Integer index)

Parameters
indexThe zero-based index of the uniform to retrieve.
Returns
Murl.Graph.IFloatMatrix2Uniform The uniform object, or a null pointer if the types do not match.

GetFloatMatrix3Uniform(index)

Get the uniform at a given index as a 3x3-component 32bit floating point matrix object. See GetFloatUniform().

Murl.Graph.IFloatMatrix3Uniform GetFloatMatrix3Uniform(Integer index)

Parameters
indexThe zero-based index of the uniform to retrieve.
Returns
Murl.Graph.IFloatMatrix3Uniform The uniform object, or a null pointer if the types do not match.

GetFloatMatrix4Uniform(index)

Get the uniform at a given index as a 4x4-component 32bit floating point matrix object. See GetFloatUniform().

Murl.Graph.IFloatMatrix4Uniform GetFloatMatrix4Uniform(Integer index)

Parameters
indexThe zero-based index of the uniform to retrieve.
Returns
Murl.Graph.IFloatMatrix4Uniform The uniform object, or a null pointer if the types do not match.

GetSInt32Uniform(index)

Get the attribute at a given index as a scalar 32bit signed integer object. See GetFloatUniform().

Murl.Graph.ISInt32Uniform GetSInt32Uniform(Integer index)

Parameters
indexThe zero-based index of the uniform to retrieve.
Returns
Murl.Graph.ISInt32Uniform The uniform object, or a null pointer if the types do not match.

GetSInt32Vector2Uniform(index)

Get the uniform at a given index as a 2-component 32bit signed integer vector object. See GetFloatUniform().

Murl.Graph.ISInt32Vector2Uniform GetSInt32Vector2Uniform(Integer index)

Parameters
indexThe zero-based index of the uniform to retrieve.
Returns
Murl.Graph.ISInt32Vector2Uniform The uniform object, or a null pointer if the types do not match.

GetSInt32Vector3Uniform(index)

Get the uniform at a given index as a 3-component 32bit signed integer vector object. See GetFloatUniform().

Murl.Graph.ISInt32Vector3Uniform GetSInt32Vector3Uniform(Integer index)

Parameters
indexThe zero-based index of the uniform to retrieve.
Returns
Murl.Graph.ISInt32Vector3Uniform The uniform object, or a null pointer if the types do not match.

GetSInt32Vector4Uniform(index)

Get the uniform at a given index as a 4-component 32bit signed integer vector object. See GetFloatUniform().

Murl.Graph.ISInt32Vector4Uniform GetSInt32Vector4Uniform(Integer index)

Parameters
indexThe zero-based index of the uniform to retrieve.
Returns
Murl.Graph.ISInt32Vector4Uniform The uniform object, or a null pointer if the types do not match.