Elaztek Developer Hub
Blamite Game Engine - blam!  00406.12.10.23.1457.blamite
The core library for the Blamite Game Engine.
Blam::Rendering::Materials Namespace Reference

Namespace containing functions for interacting with materials. More...

Functions

BLAM void RebuildDatablocks ()
 Rebuilds ALL datablocks (including instances) from their original tags. More...
 
BLAM bool BuildDatablockFromTag (material *material_tag, std::string tag_path)
 Creates an OGRE material datablock from a material tag. More...
 
BLAM void ReloadPendingMaterials ()
 Reloads all datablocks which are flagged as requiring a reload. More...
 
BLAM Ogre::HlmsDatablock * GetDatablockFromTag (std::string tag_path)
 Retrieves an OGRE datablock from a material tag path. More...
 
BLAM ogre_material_instance_dataGetDatablockInstanceFromTag (std::string tag_path, std::string referencing_tag_path)
 Retrieves a datablock instance from a material tag path, and a referencing tag path. More...
 
BLAM ogre_material_instance_dataCreateDatablockInstance (std::string tag_path, std::string referencing_tag_path)
 Creates a new datablock instance from a material tag path, and a referencing tag path. More...
 
BLAM bool LoadPBSDatablockFromMaterialTag (Ogre::HlmsPbsDatablock *datablock, material *material_tag)
 Loads a PBS (Physically-Based Shading) datablock from a material tag. More...
 
BLAM bool LoadUnlitDatablockFromMaterialTag (Ogre::HlmsUnlitDatablock *datablock, material *material_tag)
 Loads an Unlit datablock from a material tag. More...
 
BLAM Ogre::HlmsUnlitDatablock * CreateDefaultUnlitDatablock (std::string id)
 Creates a default Unlit datablock. More...
 
BLAM Ogre::HlmsUnlitDatablock * CreateDefaultUnlitDatablockForPrimitives (std::string id)
 Creates a default Unlit datablock for use with 2D and 3D primitives. More...
 
BLAM Ogre::HlmsPbsDatablock * CreateDefaultPbsDatablock (std::string id)
 Creates a default PBS datablock. More...
 
BLAM Ogre::HlmsPbsDatablock * CreateDefaultPbsDatablockForPrimitives (std::string id)
 Creates a default PBS datablock for use with 2D and 3D primitives. More...
 

Detailed Description

Namespace containing functions for interacting with materials.

Function Documentation

◆ BuildDatablockFromTag()

bool Blam::Rendering::Materials::BuildDatablockFromTag ( material material_tag,
std::string  tag_path 
)

Creates an OGRE material datablock from a material tag.

Parameters
material_tag- The material tag data to create a datablock from.
tag_path- The tag path of the provided material tag.
Returns
true if the datablock was loaded successfully, otherwise returns false.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CreateDatablockInstance()

ogre_material_instance_data * Blam::Rendering::Materials::CreateDatablockInstance ( std::string  tag_path,
std::string  referencing_tag_path 
)

Creates a new datablock instance from a material tag path, and a referencing tag path.

Parameters
tag_path- The tag path of the desired material.
referencing_tag_path- The tag path of the tag which referenced the material.
Returns
Pointer to the newly created material instance information, or nullptr if the instance could not be created.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CreateDefaultPbsDatablock()

Ogre::HlmsPbsDatablock * Blam::Rendering::Materials::CreateDefaultPbsDatablock ( std::string  id)

Creates a default PBS datablock.

This function will create and register a default PBS datablock within OGRE.

Parameters
id- The ID of the newly created datablock. This ID is provided to OGRE to identify the datablock.
Returns
Pointer to the newly created datablock.

◆ CreateDefaultPbsDatablockForPrimitives()

Ogre::HlmsPbsDatablock * Blam::Rendering::Materials::CreateDefaultPbsDatablockForPrimitives ( std::string  id)

Creates a default PBS datablock for use with 2D and 3D primitives.

This function will create and register a default PBS datablock within OGRE. It will also have several modifications pre-applied to ensure it is ready for use in 2D and 3D primitives.

Parameters
id- The ID of the newly created datablock. This ID is provided to OGRE to identify the datablock.
Returns
Pointer to the newly created datablock.

◆ CreateDefaultUnlitDatablock()

Ogre::HlmsUnlitDatablock * Blam::Rendering::Materials::CreateDefaultUnlitDatablock ( std::string  id)

Creates a default Unlit datablock.

This function will create and register a default Unlit datablock within OGRE.

Parameters
id- The ID of the newly created datablock. This ID is provided to OGRE to identify the datablock.
Returns
Pointer to the newly created datablock.
+ Here is the caller graph for this function:

◆ CreateDefaultUnlitDatablockForPrimitives()

Ogre::HlmsUnlitDatablock * Blam::Rendering::Materials::CreateDefaultUnlitDatablockForPrimitives ( std::string  id)

Creates a default Unlit datablock for use with 2D and 3D primitives.

This function will create and register a default Unlit datablock within OGRE. It will also have several modifications pre-applied to ensure it is ready for use in 2D and 3D primitives.

Parameters
id- The ID of the newly created datablock. This ID is provided to OGRE to identify the datablock.
Returns
Pointer to the newly created datablock.
+ Here is the caller graph for this function:

◆ GetDatablockFromTag()

Ogre::HlmsDatablock * Blam::Rendering::Materials::GetDatablockFromTag ( std::string  tag_path)

Retrieves an OGRE datablock from a material tag path.

Parameters
tag_path- The tag path of the desired material datablock.
Returns
Pointer to the associated datablock, or nullptr if the tag path is invalid or could not be found.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetDatablockInstanceFromTag()

ogre_material_instance_data * Blam::Rendering::Materials::GetDatablockInstanceFromTag ( std::string  tag_path,
std::string  referencing_tag_path 
)

Retrieves a datablock instance from a material tag path, and a referencing tag path.

Parameters
tag_path- The tag path of the desired material.
referencing_tag_path- The tag path of the tag which referenced the material.
Returns
Pointer to the material instance information, or nullptr if no material instance could be found.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ LoadPBSDatablockFromMaterialTag()

bool Blam::Rendering::Materials::LoadPBSDatablockFromMaterialTag ( Ogre::HlmsPbsDatablock *  datablock,
material material_tag 
)

Loads a PBS (Physically-Based Shading) datablock from a material tag.

Parameters
datablock- The datablock that should be updated to match the provided material tag. This should usually be a default datablock.
material_tag- The material tag to create a datablock from.
Returns
true if the datablock was created successfully, otherwise returns false.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ LoadUnlitDatablockFromMaterialTag()

bool Blam::Rendering::Materials::LoadUnlitDatablockFromMaterialTag ( Ogre::HlmsUnlitDatablock *  datablock,
material material_tag 
)

Loads an Unlit datablock from a material tag.

Parameters
datablock- The datablock that should be updated to match the provided material tag. This should usually be a default datablock.
material_tag- The material tag to create a datablock from.
Returns
true if the datablock was created successfully, otherwise returns false.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ RebuildDatablocks()

void Blam::Rendering::Materials::RebuildDatablocks ( )

Rebuilds ALL datablocks (including instances) from their original tags.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ReloadPendingMaterials()

void Blam::Rendering::Materials::ReloadPendingMaterials ( )

Reloads all datablocks which are flagged as requiring a reload.

Materials which either have needs_update set, or are configured to persistently reload will be reloaded from this function - other materials will NOT be reloaded.

+ Here is the call graph for this function:
+ Here is the caller graph for this function: