Nebula
|
Material special version of variant.
Classes | |
struct | MaterialBuffer |
struct | MaterialConstant |
struct | MaterialId |
struct | MaterialInstanceId |
class | MaterialLoader |
struct | MaterialTexture |
struct | MaterialVariant |
struct | ShaderConfigBatchTexture |
Typedefs | |
typedef IndexT | BatchIndex |
typedef 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 |
typedef Ids::IdAllocator< uint > | MaterialInstanceAllocator |
using | LoaderFunc = void(*)(Ptr<IO::BXmlReader>, Materials::MaterialId, Util::StringAtom) |
Enumerations | |
enum | { Material_MinLOD , Material_LODTextures , Material_Table , Material_Buffer , Material_InstanceTables , Material_InstanceBuffers , Material_Textures , Material_Constants , Material_BufferOffset , Material_Template } |
enum | MaterialInstanceMembers { MaterialInstance_Offsets } |
Functions | |
MaterialId | CreateMaterial (const MaterialTemplates::Entry *entry) |
Create material. | |
void | DestroyMaterial (const MaterialId id) |
Destroy material. | |
void | MaterialSetTexture (const MaterialId mat, const ShaderConfigBatchTexture *bind, const Resources::ResourceId tex) |
Set texture. | |
void | MaterialSetTexture (const MaterialId mat, uint name, const Resources::ResourceId tex) |
Set texture. | |
void | MaterialSetTextureBindless (const MaterialId mat, uint name, const uint handle, const uint offset, const Resources::ResourceId tex) |
Set bindless texture. | |
void | MaterialSetConstants (const MaterialId mat, const void *data, const uint size) |
Set all material constants. | |
void | MaterialSetConstant (const MaterialId mat, const void *data, const uint size, const uint offset) |
Set a material constant. | |
void | MaterialSetBufferBinding (const MaterialId id, IndexT index) |
Set material GPU buffer binding. | |
IndexT | MaterialGetBufferBinding (const MaterialId id) |
Get material GPU buffer binding. | |
void | MaterialAddLODTexture (const MaterialId mat, const Resources::ResourceId tex) |
Add texture to LOD update. | |
void | MaterialSetLowestLod (const MaterialId mat, float lod) |
Update LOD for material. | |
const MaterialTemplates::Entry * | MaterialGetTemplate (const MaterialId mat) |
Get material shader config. | |
const Materials::BatchIndex | MaterialGetBatchIndex (const MaterialId mat, const MaterialTemplates::BatchGroup batch) |
Get batch index from code. | |
uint64_t | MaterialGetSortCode (const MaterialId mat) |
Get sort code. | |
void | MaterialApply (const MaterialId id, const CoreGraphics::CmdBufferId buf, IndexT index) |
Apply material. | |
MaterialInstanceId | CreateMaterialInstance (const MaterialId material) |
Create material instance. | |
void | DestroyMaterialInstance (const MaterialInstanceId materialInstance) |
Destroy material instance. | |
CoreGraphics::ConstantBufferOffset | MaterialInstanceAllocate (const MaterialInstanceId mat, const BatchIndex batch) |
Allocate instance constants, call per frame when instance constants are needed. | |
void | MaterialInstanceApply (const MaterialInstanceId id, const CoreGraphics::CmdBufferId buf, IndexT index, IndexT bufferIndex) |
Apply material instance. | |
SizeT | MaterialInstanceBufferSize (const MaterialInstanceId sur, const BatchIndex batch) |
Get material instance buffer size for batch. | |
__ImplementClass (Materials::MaterialLoader, 'MALO', Resources::ResourceLoader) | |
void | LoadTexture (const Ptr< IO::BXmlReader > &reader, CoreGraphics::TextureId def, const char *name, const char *tag, uint &handle, bool &dirtyFlag) |
void | LoadVec4 (const Ptr< IO::BXmlReader > &reader, const char *name, float value[4], const Math::vec4 &def) |
void | LoadVec3 (const Ptr< IO::BXmlReader > &reader, const char *name, float value[3], const Math::vec3 &def) |
void | LoadFloat (const Ptr< IO::BXmlReader > &reader, const char *name, float &value, const float def) |
void | LoadMaterialParameter (Ptr< IO::BXmlReader > reader, Util::StringAtom name, const MaterialTemplates::Entry *entry, const Materials::MaterialId id, bool immediate) |
Variables | ||
MaterialAllocator | materialAllocator | |
MaterialInstanceAllocator | materialInstanceAllocator | |
Threading::CriticalSection | materialTextureLoadSection | |
material | ||
Util::Dictionary< MaterialTemplates::MaterialProperties, LoaderFunc > | LoaderMap | |
struct { | ||
MATERIAL_LIST MaterialInterfaces::MaterialBindings Materials::bindings | ||
CoreGraphics::BufferWithStaging Materials::materialBindingBuffer | ||
Threading::CriticalSection Materials::variantAllocatorLock | ||
Memory::ArenaAllocator< 4096 > Materials::variantAllocator | ||
union DirtySet { | ||
struct { | ||
bool Materials::graphicsDirty: 1 | ||
bool Materials::computeDirty: 1 | ||
} | ||
int Materials::bits | ||
} Materials::dirtySet | ||
} | state | |
typedef IndexT Materials::BatchIndex |
using Materials::LoaderFunc = void(*)(Ptr<IO::BXmlReader>, Materials::MaterialId, Util::StringAtom) |
typedef 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* > Materials::MaterialAllocator |
anonymous enum |
Materials::__ImplementClass | ( | Materials::MaterialLoader | , |
'MALO' | , | ||
Resources::ResourceLoader | ) |
MaterialId Materials::CreateMaterial | ( | const MaterialTemplates::Entry * | entry | ) |
Create material.
MaterialInstanceId Materials::CreateMaterialInstance | ( | const MaterialId | material | ) |
Create material instance.
void Materials::DestroyMaterial | ( | const MaterialId | id | ) |
Destroy material.
void Materials::DestroyMaterialInstance | ( | const MaterialInstanceId | materialInstance | ) |
Destroy material instance.
void Materials::LoadFloat | ( | const Ptr< IO::BXmlReader > & | reader, |
const char * | name, | ||
float & | value, | ||
const float | def ) |
void Materials::LoadMaterialParameter | ( | Ptr< IO::BXmlReader > | reader, |
Util::StringAtom | name, | ||
const MaterialTemplates::Entry * | entry, | ||
const Materials::MaterialId | id, | ||
bool | immediate ) |
void Materials::LoadTexture | ( | const Ptr< IO::BXmlReader > & | reader, |
CoreGraphics::TextureId | def, | ||
const char * | name, | ||
const char * | tag, | ||
uint & | handle, | ||
bool & | dirtyFlag ) |
void Materials::LoadVec3 | ( | const Ptr< IO::BXmlReader > & | reader, |
const char * | name, | ||
float | value[3], | ||
const Math::vec3 & | def ) |
void Materials::LoadVec4 | ( | const Ptr< IO::BXmlReader > & | reader, |
const char * | name, | ||
float | value[4], | ||
const Math::vec4 & | def ) |
void Materials::MaterialAddLODTexture | ( | const MaterialId | mat, |
const Resources::ResourceId | tex ) |
Add texture to LOD update.
void Materials::MaterialApply | ( | const MaterialId | id, |
const CoreGraphics::CmdBufferId | buf, | ||
IndexT | index ) |
Apply material.
const Materials::BatchIndex Materials::MaterialGetBatchIndex | ( | const MaterialId | mat, |
const MaterialTemplates::BatchGroup | batch ) |
Get batch index from code.
IndexT Materials::MaterialGetBufferBinding | ( | const MaterialId | id | ) |
Get material GPU buffer binding.
uint64_t Materials::MaterialGetSortCode | ( | const MaterialId | mat | ) |
Get sort code.
const MaterialTemplates::Entry * Materials::MaterialGetTemplate | ( | const MaterialId | mat | ) |
Get material shader config.
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 | mat, |
const BatchIndex | batch ) |
Get material instance buffer size for batch.
void Materials::MaterialSetBufferBinding | ( | const MaterialId | id, |
IndexT | index ) |
Set material GPU buffer binding.
void Materials::MaterialSetConstant | ( | const MaterialId | mat, |
const void * | data, | ||
const uint | size, | ||
const uint | offset ) |
Set a material constant.
void Materials::MaterialSetConstants | ( | const MaterialId | mat, |
const void * | data, | ||
const uint | size ) |
Set all material constants.
void Materials::MaterialSetLowestLod | ( | const MaterialId | mat, |
float | lod ) |
Update LOD for 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.
MATERIAL_LIST MaterialInterfaces::MaterialBindings Materials::bindings |
int Materials::bits |
bool Materials::computeDirty |
union { ... } ::DirtySet Materials::dirtySet |
bool Materials::graphicsDirty |
Util::Dictionary<MaterialTemplates::MaterialProperties, LoaderFunc> Materials::LoaderMap |
Materials::material |
MaterialAllocator Materials::materialAllocator |
CoreGraphics::BufferWithStaging Materials::materialBindingBuffer |
MaterialInstanceAllocator Materials::materialInstanceAllocator |
Threading::CriticalSection Materials::materialTextureLoadSection |
struct { ... } Materials::state |
Memory::ArenaAllocator<4096> Materials::variantAllocator |
Threading::CriticalSection Materials::variantAllocatorLock |