MaterialInstance

Inherited: None

Description

The MaterialInstance class enables customization of material parameters and textures for rendering objects. It supports various types of parameters, and the customization can be done per-instance.

Public Methods

Material *

material () const

int

paramCount () const

std::string

paramName (int index) const

Variant

paramValue (int index) const

void

setBufferValue (const char * name, const void * value)

void

setSurfaceType (int type)

void

setTexture (const char * name, Texture * texture)

int

surfaceType () const

Texture *

texture (const char * name)

Static Methods

None

Methods Description

:ref:`Material<api_Material>`* MaterialInstance::material () const

Getter for the base material associated with the instance.


int MaterialInstance::paramCount () const

Gets the total count of parameters in the material.


std::string MaterialInstance::paramName (int index) const

Gets the name of a parameter by index.


Variant MaterialInstance::paramValue (int index) const

Gets the overridden or default value of a parameter by index.


void MaterialInstance::setBufferValue (char * name, void * value)

Sets the value of a parameter with specified name in the uniform buffer.


void MaterialInstance::setSurfaceType (int type)

Sets the surface type associated with the material instance.

See also surfaceType().


void MaterialInstance::setTexture (char * name, Texture * texture)

Sets a texture parameter with specified name.

See also *texture*().


int MaterialInstance::surfaceType () const

Gets the surface type associated with the material instance.

See also setSurfaceType().


:ref:`Texture<api_Texture>`* MaterialInstance::texture (char * name)

Getter for the overridden texture associated with a specific parameter name.

See also setTexture().