Nebula
Loading...
Searching...
No Matches
material.cc File Reference
#include "material.h"
#include "shaderconfig.h"
#include "resources/resourceserver.h"
#include "materials/materialtemplates.h"

Namespaces

namespace  Materials
 Material special version of variant.
 

Functions

MaterialId Materials::CreateMaterial (const MaterialTemplates::Entry *entry)
 Create material.
 
void Materials::DestroyMaterial (const MaterialId id)
 Destroy material.
 
void Materials::MaterialSetTexture (const MaterialId mat, const ShaderConfigBatchTexture *bind, const Resources::ResourceId tex)
 Set texture.
 
void Materials::MaterialSetTexture (const MaterialId mat, uint name, const Resources::ResourceId tex)
 Set texture.
 
void Materials::MaterialSetTextureBindless (const MaterialId mat, uint name, const uint handle, const uint offset, const Resources::ResourceId tex)
 Set bindless texture.
 
void Materials::MaterialSetConstants (const MaterialId mat, const void *data, const uint size)
 Set all material constants.
 
void Materials::MaterialSetConstant (const MaterialId mat, const void *data, const uint size, const uint offset)
 Set a material constant.
 
void Materials::MaterialSetBufferBinding (const MaterialId id, IndexT index)
 Set material GPU buffer binding.
 
IndexT Materials::MaterialGetBufferBinding (const MaterialId id)
 Get material GPU buffer binding.
 
void Materials::MaterialAddLODTexture (const MaterialId mat, const Resources::ResourceId tex)
 Add texture to LOD update.
 
void Materials::MaterialSetLowestLod (const MaterialId mat, float lod)
 Update LOD for material.
 
const MaterialTemplates::EntryMaterials::MaterialGetTemplate (const MaterialId mat)
 Get material shader config.
 
const Materials::BatchIndex Materials::MaterialGetBatchIndex (const MaterialId mat, const MaterialTemplates::BatchGroup batch)
 Get batch index from code.
 
uint64_t Materials::MaterialGetSortCode (const MaterialId mat)
 Get sort code.
 
void Materials::MaterialApply (const MaterialId id, const CoreGraphics::CmdBufferId buf, IndexT index)
 Apply material.
 
MaterialInstanceId Materials::CreateMaterialInstance (const MaterialId material)
 Create material instance.
 
void Materials::DestroyMaterialInstance (const MaterialInstanceId materialInstance)
 Destroy material instance.
 
CoreGraphics::ConstantBufferOffset Materials::MaterialInstanceAllocate (const MaterialInstanceId mat, const BatchIndex batch)
 Allocate instance constants, call per frame when instance constants are needed.
 
void Materials::MaterialInstanceApply (const MaterialInstanceId id, const CoreGraphics::CmdBufferId buf, IndexT index, IndexT bufferIndex)
 Apply material instance.
 
SizeT Materials::MaterialInstanceBufferSize (const MaterialInstanceId sur, const BatchIndex batch)
 Get material instance buffer size for batch.
 

Variables

MaterialAllocator Materials::materialAllocator
 
MaterialInstanceAllocator Materials::materialInstanceAllocator
 
Threading::CriticalSection Materials::materialTextureLoadSection