Skylicht Engine
Loading...
Searching...
No Matches
Skylicht::CMaterial Class Reference

The object class describes material information such as which shader it's associated with, which texture it uses, and what its color parameters are. More...

#include <Material/CMaterial.h>

Inheritance diagram for Skylicht::CMaterial:
irr::IReferenceCounted

Classes

struct  SUniformTexture
 Structure for a uniform texture parameter in the material. More...
struct  SUniformValue
 Structure for a uniform value parameter in the material. More...
struct  SExtraParams
 Structure for storing extra parameters, used when switching shaders. More...

Public Member Functions

 CMaterial (const char *name, const char *shaderPath)
 Constructs a material with the given name and shader path.
virtual ~CMaterial ()
 Destructor. Releases textures, deletes all parameters and cleans up resources.
CShadergetShader ()
 Get the shader associated with this material.
void rename (const char *name)
 Rename the material.
const char * getName ()
 Get the name of the material.
const char * getPackage ()
 Get the package name of the material.
void setPackage (const char *package)
 Set the package name for the material.
const char * getShaderPath ()
 Get the shader path of the material.
const char * getMaterialPath ()
 Get the material file path.
void setMaterialPath (const char *path)
 Set the material file path.
bool isDeferred ()
 Returns true if the material is used for deferred rendering.
void setManualInitTexture (bool b)
 Set manual initialization flag for textures.
CMaterialclone ()
 Create a deep clone of this material.
void copyTo (CMaterial *mat)
 Copy all parameters and resources to another material.
void copyParamsTo (CMaterial *mat)
 Copy only uniform parameters to another material.
void deleteAllParams ()
 Delete all uniform parameters and textures.
void deleteExtraParams ()
 Delete all extra parameters (used for shader switching).
void setUniform (const char *name, float f)
 Set a float value for a named uniform.
void setUniform2 (const char *name, float *f)
 Set a vec2 value for a named uniform.
void setUniform3 (const char *name, float *f)
 Set a vec3 value for a named uniform.
void setUniform4 (const char *name, float *f)
 Set a vec4 value for a named uniform.
void setUniform4 (const char *name, const SColor &color)
 Set a vec4 value for a named uniform from an SColor.
const char * getUniformTextureName (int slot)
 Get the name of a uniform texture by slot index.
void setUniformTexture (const char *name, const char *path, bool loadTexture=true)
 Set a uniform texture by name and path, optionally loading the texture.
void setUniformTexture (const char *name, const char *path, std::vector< std::string > &folder, bool loadTexture=true)
 Set a uniform texture by name and path, searching in specified folders.
void setUniformTexture (const char *name, ITexture *texture)
 Set a uniform texture by name, using an ITexture pointer.
void setUniformTextureWrapU (const char *name, int wrapU)
 Set the wrapping mode in U direction for a uniform texture.
void setUniformTextureWrapV (const char *name, int wrapV)
 Set the wrapping mode in V direction for a uniform texture.
SExtraParamsnewExtra (const char *shaderPath)
 Create a new extra parameter block for a specific shader path.
void setExtraUniformTexture (SExtraParams *e, const char *name, const char *path)
 Set the path for an extra uniform texture.
void setExtraUniform (SExtraParams *e, const char *name, float *f, int floatSize)
 Set a value for an extra uniform.
void setExtraUniformTextureWrapU (SExtraParams *e, const char *name, int wrapU)
 Set wrapping mode U for extra uniform texture.
void setExtraUniformTextureWrapV (SExtraParams *e, const char *name, int wrapV)
 Set wrapping mode V for extra uniform texture.
std::vector< SUniformValue * > & getUniformParams ()
 Get a reference to the uniform value parameters vector.
std::vector< SUniformTexture * > & getUniformTexture ()
 Get a reference to the uniform texture parameters vector.
std::vector< SExtraParams * > & getExtraParams ()
 Get a reference to the extra parameters vector.
void setBackfaceCulling (bool b)
 Enable or disable backface culling for the material.
bool isBackfaceCulling ()
 Returns whether backface culling is enabled.
void setFrontfaceCulling (bool b)
 Enable or disable frontface culling for the material.
bool isFrontfaceCulling ()
 Returns whether frontface culling is enabled.
void setZWrite (bool b)
 Enable or disable Z-buffer writing for the material.
bool isZWrite ()
 Returns whether Z-buffer writing is enabled.
void setZTest (video::E_COMPARISON_FUNC f)
 Set the Z-buffer comparison function.
video::E_COMPARISON_FUNC getZTest ()
 Get the Z-buffer comparison function.
SUniformValuegetUniform (const char *name)
 Get a uniform value by name (creates if not found).
SUniformTexturegetUniformTexture (const char *name)
 Get a uniform texture by name (creates if not found).
SUniformValuegetExtraUniform (SExtraParams *e, const char *name)
 Get an extra uniform value by name (creates if not found).
SUniformTexturegetExtraUniformTexture (SExtraParams *e, const char *name)
 Get an extra uniform texture by name (creates if not found).
CShaderParamsgetShaderParams ()
 Get the shader parameter set for this material.
bool haveUniform (const char *name)
 Returns true if the uniform with the given name exists.
void initMaterial ()
 Initializes the material by loading the shader and setting up all parameters.
void setTexture (ITexture **textures, int num)
 Set textures for all slots using an array.
void setTexture (int slot, ITexture *texture)
 Set the texture for a specific slot.
ITexturegetTexture (int slot)
 Get the texture assigned to a slot.
void setProperty (const std::string &name, const std::string &value)
 Set a material property by name.
std::string getProperty (const std::string &name)
 Get a material property value by name.
void loadDefaultTexture ()
 Load default textures specified by the shader.
void loadUniformTexture ()
 Load all uniform textures assigned to this material.
void unloadDefaultTexture ()
 Unload all default textures.
void unloadUniformTexture ()
 Unload all uniform textures.
void unloadUniformTexture (const char *name)
 Unload a specific uniform texture by name.
void setOverrideResource (ITexture *texture, CShader::EResourceType type)
 Override a resource texture for this material.
void changeShader (CShader *shader)
 Change the shader for this material.
void changeShader (const char *path)
 Change the shader for this material using a path.
bool autoDetectLoadTexture ()
 Automatically detect and load textures based on shader and uniform settings.
void applyMaterial ()
 Apply material properties and textures internally (no arguments).
void applyMaterial (SMaterial &mat)
 Update textures for the passed SMaterial.
void updateTexture (SMaterial &mat)
 Replace a texture resource with a new texture in all relevant slots and uniforms.
void replaceTexture (ITexture *oldTexture, ITexture *newTexture)
 Replace a texture resource with a new texture in all relevant slots and uniforms.
void updateShaderParams ()
 Update internal shader parameter values based on uniforms.
Public Member Functions inherited from irr::IReferenceCounted
 IReferenceCounted ()
 Constructor.
virtual ~IReferenceCounted ()
 Destructor.
void grab () const
 Grabs the object. Increments the reference counter by one.
bool drop () const
 Drops the object. Decrements the reference counter by one.
s32 getReferenceCount () const
 Get the reference count.
const c8getDebugName () const
 Returns the debug name of the object.

Protected Member Functions

void bindUniformParam ()
 Bind uniform parameter slots to shader uniforms.
void updateSetTextureSlot ()
 Update and assign texture slots for all uniforms.
void initDefaultValue ()
 Initialize default values for material uniforms based on shader defaults.
void setDefaultValue (SUniformValue *v, SUniform *u)
 Set default value for a uniform value using shader information.
SUniformValuenewUniform (const char *name, int floatSize)
 Create a new uniform value with given name and float size.
SUniformTexturenewUniformTexture (const char *name)
 Create a new uniform texture with given name.
SUniformTexturenewExtraUniformTexture (SExtraParams *e, const char *name)
 Create a new extra uniform texture for a specific extra parameter block.
SUniformValuenewExtraUniform (SExtraParams *e, const char *name, int floatSize)
 Create a new extra uniform value for a specific extra parameter block.
void addShaderUI (CShader::SUniformUI *ui)
 Add a shader UI control (from shader XML) to the material's uniforms.
SExtraParamsgetExtraParams (const char *shaderPath)
 Get extra parameter block by shader path.
void saveExtraParams ()
 Save extra parameters for the current shader path.
void reloadExtraParams (const char *shaderPath)
 Reload extra parameters for the given shader path.
SUniformTexturefindExtraTexture (const char *name)
 Find an extra texture by name among all extra parameter blocks.
SUniformValuefindExtraParam (const char *name, int floatSize)
 Find an extra uniform value by name and float size among all extra parameter blocks.
Protected Member Functions inherited from irr::IReferenceCounted
void setDebugName (const c8 *newName)
 Sets the debug name of the object.

Detailed Description

The object class describes material information such as which shader it's associated with, which texture it uses, and what its color parameters are.

Skylicht-Editor

You can create materials in two ways

Method 1: Select the model file (.fbx, .dae) and click the "Export Material" button

Method 2: Create it manually by choosing the menu Asset/Create/Material.

Adjusting materials:

The Material Property window allows you to add multiple materials within a .mat file. It also includes functions like delete/rename.

Material property


Delete/Rename Material

Next, drag the shader .xml file into the Shader Field to select the material's shader.

From there, you can then drag texture files into the various uniform textures, or adjust the parameters defined within the shader .xml.

Materials are essential for the CRenderMesh component to display the model's appearance on the Skylicht-Engine

You use CMaterialManager to support loading .mat material files.

std::vector<std::string> textureFolders;
ArrayMaterial& materials = CMaterialManager::getInstance()->loadMaterial(
"SampleModels/BlendShape/Cat.mat",
true,
textureFolders
);
for (CMaterial* mat: materials)
{
printf("%s\n", mat->getName());
}
CMaterial(const char *name, const char *shaderPath)
Constructs a material with the given name and shader path.

Constructor & Destructor Documentation

◆ CMaterial()

Skylicht::CMaterial::CMaterial ( const char * name,
const char * shaderPath )

Constructs a material with the given name and shader path.

Parameters
nameName of the material.
shaderPathPath to the shader file.

Member Function Documentation

◆ addShaderUI()

void Skylicht::CMaterial::addShaderUI ( CShader::SUniformUI * ui)
protected

Add a shader UI control (from shader XML) to the material's uniforms.

Parameters
uiPointer to uniform UI definition.

◆ applyMaterial()

void Skylicht::CMaterial::applyMaterial ( SMaterial & mat)

Update textures for the passed SMaterial.

Parameters
matReference to SMaterial.

◆ autoDetectLoadTexture()

bool Skylicht::CMaterial::autoDetectLoadTexture ( )

Automatically detect and load textures based on shader and uniform settings.

Returns
True if all textures are found and loaded, false otherwise.

◆ changeShader() [1/2]

void Skylicht::CMaterial::changeShader ( const char * path)

Change the shader for this material using a path.

Parameters
pathPath to new shader file.

◆ changeShader() [2/2]

void Skylicht::CMaterial::changeShader ( CShader * shader)

Change the shader for this material.

Parameters
shaderPointer to new shader.

◆ clone()

CMaterial * Skylicht::CMaterial::clone ( )

Create a deep clone of this material.

Returns
Pointer to the cloned material.

◆ copyParamsTo()

void Skylicht::CMaterial::copyParamsTo ( CMaterial * mat)

Copy only uniform parameters to another material.

Parameters
matTarget material to copy parameters to.

◆ copyTo()

void Skylicht::CMaterial::copyTo ( CMaterial * mat)

Copy all parameters and resources to another material.

Parameters
matTarget material to copy parameters to.

◆ findExtraParam()

SUniformValue * Skylicht::CMaterial::findExtraParam ( const char * name,
int floatSize )
protected

Find an extra uniform value by name and float size among all extra parameter blocks.

Parameters
nameUniform name.
floatSizeNumber of floats.
Returns
Pointer to SUniformValue, or NULL if not found.

◆ findExtraTexture()

SUniformTexture * Skylicht::CMaterial::findExtraTexture ( const char * name)
protected

Find an extra texture by name among all extra parameter blocks.

Parameters
nameUniform texture name.
Returns
Pointer to SUniformTexture, or NULL if not found.

◆ getExtraParams() [1/2]

std::vector< SExtraParams * > & Skylicht::CMaterial::getExtraParams ( )
inline

Get a reference to the extra parameters vector.

Returns
Reference to vector of SExtraParams pointers.

◆ getExtraParams() [2/2]

SExtraParams * Skylicht::CMaterial::getExtraParams ( const char * shaderPath)
protected

Get extra parameter block by shader path.

Parameters
shaderPathShader path string.
Returns
Pointer to SExtraParams instance, or NULL if not found.

◆ getExtraUniform()

SUniformValue * Skylicht::CMaterial::getExtraUniform ( SExtraParams * e,
const char * name )

Get an extra uniform value by name (creates if not found).

Parameters
ePointer to extra parameter block.
nameUniform name.
Returns
Pointer to SUniformValue instance.

◆ getExtraUniformTexture()

SUniformTexture * Skylicht::CMaterial::getExtraUniformTexture ( SExtraParams * e,
const char * name )

Get an extra uniform texture by name (creates if not found).

Parameters
ePointer to extra parameter block.
nameUniform texture name.
Returns
Pointer to SUniformTexture instance.

◆ getMaterialPath()

const char * Skylicht::CMaterial::getMaterialPath ( )
inline

Get the material file path.

Returns
Material file path string.

◆ getName()

const char * Skylicht::CMaterial::getName ( )
inline

Get the name of the material.

Returns
Material name string.

◆ getPackage()

const char * Skylicht::CMaterial::getPackage ( )
inline

Get the package name of the material.

Returns
Package name string.
See also
CMaterialManager

◆ getProperty()

std::string Skylicht::CMaterial::getProperty ( const std::string & name)

Get a material property value by name.

Parameters
nameProperty name.
Returns
Property value string.

◆ getShader()

CShader * Skylicht::CMaterial::getShader ( )
inline

Get the shader associated with this material.

Returns
Pointer to the shader.

◆ getShaderParams()

CShaderParams & Skylicht::CMaterial::getShaderParams ( )
inline

Get the shader parameter set for this material.

Returns
Reference to CShaderParams instance.

◆ getShaderPath()

const char * Skylicht::CMaterial::getShaderPath ( )
inline

Get the shader path of the material.

Returns
Shader path string.

◆ getTexture()

ITexture * Skylicht::CMaterial::getTexture ( int slot)

Get the texture assigned to a slot.

Parameters
slotSlot index.
Returns
Pointer to texture.

◆ getUniform()

SUniformValue * Skylicht::CMaterial::getUniform ( const char * name)

Get a uniform value by name (creates if not found).

Parameters
nameName of the uniform.
Returns
Pointer to the SUniformValue instance.

◆ getUniformParams()

std::vector< SUniformValue * > & Skylicht::CMaterial::getUniformParams ( )
inline

Get a reference to the uniform value parameters vector.

Returns
Reference to vector of SUniformValue pointers.

◆ getUniformTexture() [1/2]

std::vector< SUniformTexture * > & Skylicht::CMaterial::getUniformTexture ( )
inline

Get a reference to the uniform texture parameters vector.

Returns
Reference to vector of SUniformTexture pointers.

◆ getUniformTexture() [2/2]

SUniformTexture * Skylicht::CMaterial::getUniformTexture ( const char * name)

Get a uniform texture by name (creates if not found).

Parameters
nameName of the uniform texture.
Returns
Pointer to SUniformTexture instance.

◆ getUniformTextureName()

const char * Skylicht::CMaterial::getUniformTextureName ( int slot)

Get the name of a uniform texture by slot index.

Parameters
slotTexture slot index.
Returns
Name string, or NULL if not found.

◆ getZTest()

video::E_COMPARISON_FUNC Skylicht::CMaterial::getZTest ( )
inline

Get the Z-buffer comparison function.

Returns
Comparison function value.

◆ haveUniform()

bool Skylicht::CMaterial::haveUniform ( const char * name)

Returns true if the uniform with the given name exists.

Parameters
nameUniform name.
Returns
True if exists, false otherwise.

◆ isBackfaceCulling()

bool Skylicht::CMaterial::isBackfaceCulling ( )
inline

Returns whether backface culling is enabled.

Returns
True if enabled, false otherwise.

◆ isDeferred()

bool Skylicht::CMaterial::isDeferred ( )
inline

Returns true if the material is used for deferred rendering.

Returns
True if deferred, false otherwise.

◆ isFrontfaceCulling()

bool Skylicht::CMaterial::isFrontfaceCulling ( )
inline

Returns whether frontface culling is enabled.

Returns
True if enabled, false otherwise.

◆ isZWrite()

bool Skylicht::CMaterial::isZWrite ( )
inline

Returns whether Z-buffer writing is enabled.

Returns
True if enabled, false otherwise.

◆ newExtra()

SExtraParams * Skylicht::CMaterial::newExtra ( const char * shaderPath)

Create a new extra parameter block for a specific shader path.

Parameters
shaderPathShader path string.
Returns
Pointer to new SExtraParams instance.

◆ newExtraUniform()

SUniformValue * Skylicht::CMaterial::newExtraUniform ( SExtraParams * e,
const char * name,
int floatSize )
protected

Create a new extra uniform value for a specific extra parameter block.

Parameters
ePointer to extra parameter block.
nameName of the uniform.
floatSizeNumber of floats.
Returns
Pointer to new SUniformValue.

◆ newExtraUniformTexture()

SUniformTexture * Skylicht::CMaterial::newExtraUniformTexture ( SExtraParams * e,
const char * name )
protected

Create a new extra uniform texture for a specific extra parameter block.

Parameters
ePointer to extra parameter block.
nameName of the uniform texture.
Returns
Pointer to new SUniformTexture.

◆ newUniform()

SUniformValue * Skylicht::CMaterial::newUniform ( const char * name,
int floatSize )
protected

Create a new uniform value with given name and float size.

Parameters
nameName of the uniform.
floatSizeNumber of floats.
Returns
Pointer to new SUniformValue.

◆ newUniformTexture()

SUniformTexture * Skylicht::CMaterial::newUniformTexture ( const char * name)
protected

Create a new uniform texture with given name.

Parameters
nameName of the uniform texture.
Returns
Pointer to new SUniformTexture.

◆ reloadExtraParams()

void Skylicht::CMaterial::reloadExtraParams ( const char * shaderPath)
protected

Reload extra parameters for the given shader path.

Parameters
shaderPathShader path string.

◆ rename()

void Skylicht::CMaterial::rename ( const char * name)
inline

Rename the material.

Parameters
nameNew name for the material.

◆ replaceTexture()

void Skylicht::CMaterial::replaceTexture ( ITexture * oldTexture,
ITexture * newTexture )

Replace a texture resource with a new texture in all relevant slots and uniforms.

Parameters
oldTexturePointer to old texture.
newTexturePointer to new texture.

◆ setBackfaceCulling()

void Skylicht::CMaterial::setBackfaceCulling ( bool b)
inline

Enable or disable backface culling for the material.

Parameters
bTrue to enable, false to disable.

◆ setDefaultValue()

void Skylicht::CMaterial::setDefaultValue ( SUniformValue * v,
SUniform * u )
protected

Set default value for a uniform value using shader information.

Parameters
vPointer to SUniformValue.
uPointer to SUniform.

◆ setExtraUniform()

void Skylicht::CMaterial::setExtraUniform ( SExtraParams * e,
const char * name,
float * f,
int floatSize )

Set a value for an extra uniform.

Parameters
ePointer to extra parameter block.
nameUniform name.
fPointer to value array.
floatSizeNumber of floats.

◆ setExtraUniformTexture()

void Skylicht::CMaterial::setExtraUniformTexture ( SExtraParams * e,
const char * name,
const char * path )

Set the path for an extra uniform texture.

Parameters
ePointer to extra parameter block.
nameUniform texture name.
pathPath to texture.

◆ setExtraUniformTextureWrapU()

void Skylicht::CMaterial::setExtraUniformTextureWrapU ( SExtraParams * e,
const char * name,
int wrapU )

Set wrapping mode U for extra uniform texture.

Parameters
ePointer to extra parameter block.
nameUniform texture name.
wrapUWrapping mode value.
See also
irr::video::E_TEXTURE_CLAMP

◆ setExtraUniformTextureWrapV()

void Skylicht::CMaterial::setExtraUniformTextureWrapV ( SExtraParams * e,
const char * name,
int wrapV )

Set wrapping mode V for extra uniform texture.

Parameters
ePointer to extra parameter block.
nameUniform texture name.
wrapVWrapping mode value.
See also
irr::video::E_TEXTURE_CLAMP

◆ setFrontfaceCulling()

void Skylicht::CMaterial::setFrontfaceCulling ( bool b)
inline

Enable or disable frontface culling for the material.

Parameters
bTrue to enable, false to disable.

◆ setManualInitTexture()

void Skylicht::CMaterial::setManualInitTexture ( bool b)
inline

Set manual initialization flag for textures.

Parameters
bTrue to enable manual initialization.

◆ setMaterialPath()

void Skylicht::CMaterial::setMaterialPath ( const char * path)
inline

Set the material file path.

Parameters
pathNew material file path string.

◆ setOverrideResource()

void Skylicht::CMaterial::setOverrideResource ( ITexture * texture,
CShader::EResourceType type )
inline

Override a resource texture for this material.

Parameters
texturePointer to texture.
typeResource type (see CShader::EResourceType).

◆ setPackage()

void Skylicht::CMaterial::setPackage ( const char * package)
inline

Set the package name for the material.

Parameters
packagePackage name string.
See also
CMaterialManager

◆ setProperty()

void Skylicht::CMaterial::setProperty ( const std::string & name,
const std::string & value )

Set a material property by name.

Parameters
nameProperty name.
valueProperty value.

◆ setTexture() [1/2]

void Skylicht::CMaterial::setTexture ( int slot,
ITexture * texture )

Set the texture for a specific slot.

Parameters
slotSlot index.
texturePointer to texture.

◆ setTexture() [2/2]

void Skylicht::CMaterial::setTexture ( ITexture ** textures,
int num )

Set textures for all slots using an array.

Parameters
texturesArray of texture pointers.
numNumber of textures.

◆ setUniform()

void Skylicht::CMaterial::setUniform ( const char * name,
float f )

Set a float value for a named uniform.

Parameters
nameName of the uniform.
fValue to set.

◆ setUniform2()

void Skylicht::CMaterial::setUniform2 ( const char * name,
float * f )

Set a vec2 value for a named uniform.

Parameters
nameName of the uniform.
fPointer to array of 2 floats.

◆ setUniform3()

void Skylicht::CMaterial::setUniform3 ( const char * name,
float * f )

Set a vec3 value for a named uniform.

Parameters
nameName of the uniform.
fPointer to array of 3 floats.

◆ setUniform4() [1/2]

void Skylicht::CMaterial::setUniform4 ( const char * name,
const SColor & color )

Set a vec4 value for a named uniform from an SColor.

Parameters
nameName of the uniform.
colorColor value to set.

◆ setUniform4() [2/2]

void Skylicht::CMaterial::setUniform4 ( const char * name,
float * f )

Set a vec4 value for a named uniform.

Parameters
nameName of the uniform.
fPointer to array of 4 floats.

◆ setUniformTexture() [1/3]

void Skylicht::CMaterial::setUniformTexture ( const char * name,
const char * path,
bool loadTexture = true )

Set a uniform texture by name and path, optionally loading the texture.

Parameters
nameUniform texture name.
pathPath to texture file.
loadTextureTrue to load the texture.

◆ setUniformTexture() [2/3]

void Skylicht::CMaterial::setUniformTexture ( const char * name,
const char * path,
std::vector< std::string > & folder,
bool loadTexture = true )

Set a uniform texture by name and path, searching in specified folders.

Parameters
nameUniform texture name.
pathPath to texture file.
folderList of folders to search for the texture.
loadTextureTrue to load the texture.

◆ setUniformTexture() [3/3]

void Skylicht::CMaterial::setUniformTexture ( const char * name,
ITexture * texture )

Set a uniform texture by name, using an ITexture pointer.

Parameters
nameUniform texture name.
texturePointer to texture.

◆ setUniformTextureWrapU()

void Skylicht::CMaterial::setUniformTextureWrapU ( const char * name,
int wrapU )

Set the wrapping mode in U direction for a uniform texture.

Parameters
nameUniform texture name.
wrapUWrapping mode value.
See also
irr::video::E_TEXTURE_CLAMP

◆ setUniformTextureWrapV()

void Skylicht::CMaterial::setUniformTextureWrapV ( const char * name,
int wrapV )

Set the wrapping mode in V direction for a uniform texture.

Parameters
nameUniform texture name.
wrapVWrapping mode value.
See also
irr::video::E_TEXTURE_CLAMP

◆ setZTest()

void Skylicht::CMaterial::setZTest ( video::E_COMPARISON_FUNC f)
inline

Set the Z-buffer comparison function.

Parameters
fComparison function value.

◆ setZWrite()

void Skylicht::CMaterial::setZWrite ( bool b)
inline

Enable or disable Z-buffer writing for the material.

Parameters
bTrue to enable, false to disable.

◆ unloadUniformTexture()

void Skylicht::CMaterial::unloadUniformTexture ( const char * name)

Unload a specific uniform texture by name.

Parameters
nameUniform texture name.

◆ updateTexture()

void Skylicht::CMaterial::updateTexture ( SMaterial & mat)

Replace a texture resource with a new texture in all relevant slots and uniforms.

Parameters
oldTexturePointer to old texture.
newTexturePointer to new texture.

The documentation for this class was generated from the following file: