Murl::Graph::IUniformContainer Interface Referenceabstract

The IUniformContainer property interface. More...

#include "murl_graph_i_uniform_container.h"

Inheritance diagram for Murl::Graph::IUniformContainer:

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 StringGetUniformName (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 IUniformGetUniform (UInt32 index) const =0
 Get the uniform object at a given index. More...
 
virtual IFloatUniformGetFloatUniform (UInt32 index) const =0
 Get the attribute at a given index as a scalar 32bit floating point object. More...
 
virtual IFloatVector2UniformGetFloatVector2Uniform (UInt32 index) const =0
 Get the uniform at a given index as a 2-component 32bit floating point vector object. More...
 
virtual IFloatVector3UniformGetFloatVector3Uniform (UInt32 index) const =0
 Get the uniform at a given index as a 3-component 32bit floating point vector object. More...
 
virtual IFloatVector4UniformGetFloatVector4Uniform (UInt32 index) const =0
 Get the uniform at a given index as a 4-component 32bit floating point vector object. More...
 
virtual IFloatMatrix2UniformGetFloatMatrix2Uniform (UInt32 index) const =0
 Get the uniform at a given index as a 2x2-component 32bit floating point matrix object. More...
 
virtual IFloatMatrix3UniformGetFloatMatrix3Uniform (UInt32 index) const =0
 Get the uniform at a given index as a 3x3-component 32bit floating point matrix object. More...
 
virtual IFloatMatrix4UniformGetFloatMatrix4Uniform (UInt32 index) const =0
 Get the uniform at a given index as a 4x4-component 32bit floating point matrix object. More...
 
virtual ISInt32UniformGetSInt32Uniform (UInt32 index) const =0
 Get the attribute at a given index as a scalar 32bit signed integer object. More...
 
virtual ISInt32Vector2UniformGetSInt32Vector2Uniform (UInt32 index) const =0
 Get the uniform at a given index as a 2-component 32bit signed integer vector object. More...
 
virtual ISInt32Vector3UniformGetSInt32Vector3Uniform (UInt32 index) const =0
 Get the uniform at a given index as a 3-component 32bit signed integer vector object. More...
 
virtual ISInt32Vector4UniformGetSInt32Vector4Uniform (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]

virtual SInt32 Murl::Graph::IUniformContainer::AddUniform ( IEnums::UniformItem  item,
IEnums::UniformType  type,
UInt32 byteOffset 
)
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
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
The zero-based index of the uniform in the container, or -1 if failed.

◆ AddUniform() [2/2]

virtual SInt32 Murl::Graph::IUniformContainer::AddUniform ( const String name,
IEnums::UniformType  type,
UInt32 byteOffset 
)
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
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
The zero-based index of the uniform in the container, or -1 if failed.

◆ GetUniformIndex() [1/2]

virtual SInt32 Murl::Graph::IUniformContainer::GetUniformIndex ( IEnums::UniformItem  item) const
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
itemThe predefined uniform to query.
Returns
The zero-based index of the uniform, or -1 if not found.

◆ GetUniformIndex() [2/2]

virtual SInt32 Murl::Graph::IUniformContainer::GetUniformIndex ( const String name) const
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
nameThe name of the user-defined uniform to query.
Returns
The zero-based index of the uniform, or -1 if not found.

◆ GetNumberOfUniforms()

virtual UInt32 Murl::Graph::IUniformContainer::GetNumberOfUniforms ( ) const
pure virtual

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

Returns
The total number of uniform added.

◆ GetUniformType()

virtual IEnums::UniformType Murl::Graph::IUniformContainer::GetUniformType ( UInt32  index) const
pure virtual

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

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

◆ GetUniformItem()

virtual IEnums::UniformItem Murl::Graph::IUniformContainer::GetUniformItem ( UInt32  index) const
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
indexThe zero-based index of the uniform to query.
Returns
The predefined uniform item.

◆ GetUniformName()

virtual const String& Murl::Graph::IUniformContainer::GetUniformName ( UInt32  index) const
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
indexThe zero-based index of the uniform to query.
Returns
The user-defined uniform variable name.

◆ GetUniformByteOffset()

virtual UInt32 Murl::Graph::IUniformContainer::GetUniformByteOffset ( UInt32  index) const
pure virtual

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

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

◆ GetUniform()

virtual IUniform* Murl::Graph::IUniformContainer::GetUniform ( UInt32  index) const
pure virtual

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
indexThe zero-based index of the uniform to retrieve.
Returns
The uniform object.

◆ GetFloatUniform()

virtual IFloatUniform* Murl::Graph::IUniformContainer::GetFloatUniform ( UInt32  index) const
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
indexThe zero-based index of the uniform to retrieve.
Returns
The uniform object, or a null pointer if the types do not match.

◆ GetFloatVector2Uniform()

virtual IFloatVector2Uniform* Murl::Graph::IUniformContainer::GetFloatVector2Uniform ( UInt32  index) const
pure virtual

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

See GetFloatUniform().

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

◆ GetFloatVector3Uniform()

virtual IFloatVector3Uniform* Murl::Graph::IUniformContainer::GetFloatVector3Uniform ( UInt32  index) const
pure virtual

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

See GetFloatUniform().

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

◆ GetFloatVector4Uniform()

virtual IFloatVector4Uniform* Murl::Graph::IUniformContainer::GetFloatVector4Uniform ( UInt32  index) const
pure virtual

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

See GetFloatUniform().

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

◆ GetFloatMatrix2Uniform()

virtual IFloatMatrix2Uniform* Murl::Graph::IUniformContainer::GetFloatMatrix2Uniform ( UInt32  index) const
pure virtual

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

See GetFloatUniform().

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

◆ GetFloatMatrix3Uniform()

virtual IFloatMatrix3Uniform* Murl::Graph::IUniformContainer::GetFloatMatrix3Uniform ( UInt32  index) const
pure virtual

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

See GetFloatUniform().

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

◆ GetFloatMatrix4Uniform()

virtual IFloatMatrix4Uniform* Murl::Graph::IUniformContainer::GetFloatMatrix4Uniform ( UInt32  index) const
pure virtual

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

See GetFloatUniform().

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

◆ GetSInt32Uniform()

virtual ISInt32Uniform* Murl::Graph::IUniformContainer::GetSInt32Uniform ( UInt32  index) const
pure virtual

Get the attribute at a given index as a scalar 32bit signed integer object.

See GetFloatUniform().

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

◆ GetSInt32Vector2Uniform()

virtual ISInt32Vector2Uniform* Murl::Graph::IUniformContainer::GetSInt32Vector2Uniform ( UInt32  index) const
pure virtual

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

See GetFloatUniform().

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

◆ GetSInt32Vector3Uniform()

virtual ISInt32Vector3Uniform* Murl::Graph::IUniformContainer::GetSInt32Vector3Uniform ( UInt32  index) const
pure virtual

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

See GetFloatUniform().

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

◆ GetSInt32Vector4Uniform()

virtual ISInt32Vector4Uniform* Murl::Graph::IUniformContainer::GetSInt32Vector4Uniform ( UInt32  index) const
pure virtual

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

See GetFloatUniform().

Parameters
indexThe 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


Copyright © 2011-2024 Spraylight GmbH.