29struct ShaderConfigBatchTexture;
72#ifdef WITH_NEBULA_EDITOR
76const Resources::ResourceId MaterialGetTexture(
const MaterialId mat,
const IndexT i);
113#ifdef WITH_NEBULA_EDITOR
114 , Material_TextureValues
130#ifdef WITH_NEBULA_EDITOR
An ID allocator associates an id with a slice in an N number of arrays.
Definition idallocator.h:39
Nebula's dynamic array class.
Definition array.h:60
Implements a fixed size one-dimensional array.
Definition fixedarray.h:20
#define ID_32_24_8_NAMED_TYPE(x, id32_name, id24_name, id8_name, combined_name)
Definition id.h:46
Acceleration structures are used to enable ray tracing on the GPU by dividing the scene into a BVH.
Definition accelerationstructure.h:24
uint ConstantBufferOffset
Definition config.h:21
Materials represent a set of settings and a correlated shader configuration, which tells the engine w...
Definition material.h:21
Material special version of variant.
Definition material.cc:11
void DestroyMaterial(const MaterialId id)
Destroy material.
Definition material.cc:159
void DestroyMaterialInstance(const MaterialInstanceId materialInstance)
Destroy material instance.
Definition material.cc:385
void MaterialApply(const MaterialId id, const CoreGraphics::CmdBufferId buf, IndexT index)
Apply material.
Definition material.cc:361
MaterialId CreateMaterial(const MaterialTemplates::Entry *entry)
Create material.
Definition material.cc:21
const Materials::BatchIndex MaterialGetBatchIndex(const MaterialId mat, const MaterialTemplates::BatchGroup batch)
Get batch index from code.
Definition material.cc:313
void MaterialSetConstant(const MaterialId mat, const void *data, const uint size, const uint offset)
Set a material constant.
Definition material.cc:243
void MaterialInstanceApply(const MaterialInstanceId id, const CoreGraphics::CmdBufferId buf, IndexT index, IndexT bufferIndex)
Apply material instance.
Definition material.cc:408
Ids::IdAllocator< uint > MaterialInstanceAllocator
Definition material.h:156
MaterialInstanceMembers
Definition material.h:151
@ MaterialInstance_Offsets
Definition material.h:152
IndexT MaterialGetBufferBinding(const MaterialId id)
Get material GPU buffer binding.
Definition material.cc:263
uint64_t MaterialGetSortCode(const MaterialId mat)
Get sort code.
Definition material.cc:322
void MaterialSetTextureBindless(const MaterialId mat, uint name, const uint handle, const uint offset, const Resources::ResourceId tex)
Set bindless texture.
Definition material.cc:214
const MaterialTemplates::Entry * MaterialGetTemplate(const MaterialId mat)
Get material shader config.
Definition material.cc:304
void MaterialAddLODTexture(const MaterialId mat, const Resources::ResourceId tex)
Add texture to LOD update.
Definition material.cc:272
SizeT MaterialInstanceBufferSize(const MaterialInstanceId mat, const BatchIndex batch)
Get material instance buffer size for batch.
Definition material.cc:426
MaterialAllocator materialAllocator
Definition material.cc:13
void MaterialSetBufferBinding(const MaterialId id, IndexT index)
Set material GPU buffer binding.
Definition material.cc:254
MaterialInstanceAllocator materialInstanceAllocator
Definition material.cc:14
void MaterialSetLowestLod(const MaterialId mat, float lod)
Update LOD for material.
Definition material.cc:285
@ Material_InstanceTables
Definition material.h:107
@ Material_Textures
Definition material.h:109
@ Material_MinLOD
Definition material.h:103
@ Material_Buffer
Definition material.h:106
@ Material_BufferOffset
Definition material.h:111
@ Material_Constants
Definition material.h:110
@ Material_LODTextures
Definition material.h:104
@ Material_Template
Definition material.h:112
@ Material_Table
Definition material.h:105
@ Material_InstanceBuffers
Definition material.h:108
IndexT BatchIndex
Definition material.h:33
CoreGraphics::ConstantBufferOffset MaterialInstanceAllocate(const MaterialInstanceId mat, const BatchIndex batch)
Allocate instance constants, call per frame when instance constants are needed.
Definition material.cc:394
Ids::IdAllocator< float, Util::Array< Resources::ResourceId >, Util::FixedArray< CoreGraphics::ResourceTableId >, CoreGraphics::BufferId, Util::FixedArray< Util::FixedArray< CoreGraphics::ResourceTableId > >, Util::FixedArray< Util::Tuple< IndexT, SizeT > >, Util::FixedArray< Util::Array< MaterialTexture > >, Util::FixedArray< Util::Array< MaterialConstant > >, IndexT, const MaterialTemplates::Entry * > MaterialAllocator
Definition material.h:133
void MaterialSetTexture(const MaterialId mat, const ShaderConfigBatchTexture *bind, const Resources::ResourceId tex)
Set texture.
Definition material.cc:168
material
Definition material.h:31
MaterialInstanceId CreateMaterialInstance(const MaterialId material)
Create material instance.
Definition material.cc:370
void MaterialSetConstants(const MaterialId mat, const void *data, const uint size)
Set all material constants.
Definition material.cc:232
#define RESOURCE_ID_TYPE(type)
Definition resourceid.h:41
Definition commandbuffer.h:155
texture type
Definition texture.h:25
Definition materialtemplatetypes.h:65
IndexT binding
Definition material.h:86
MaterialVariant defaultValue
Definition material.h:83
CoreGraphics::BufferId buffer
Definition material.h:87
MaterialConstant()
Definition material.h:89
bool instanceConstant
Definition material.h:85
IndexT bufferIndex
Definition material.h:84
CoreGraphics::TextureId defaultValue
Definition material.h:97
IndexT slot
Definition material.h:98
Definition materialvariant.h:15
Definition shaderconfig.h:30
unsigned char ubyte
Definition types.h:34
int SizeT
Definition types.h:49
unsigned int uint
Definition types.h:31
int IndexT
Definition types.h:48