Nebula
Loading...
Searching...
No Matches
material.h File Reference
#include "ids/id.h"
#include "ids/idallocator.h"
#include "resources/resourceid.h"
#include "coregraphics/texture.h"
#include "coregraphics/buffer.h"
#include "materialvariant.h"

Go to the source code of this file.

Classes

struct  Materials::MaterialId
 
struct  Materials::MaterialInstanceId
 
struct  Materials::MaterialConstant
 
struct  Materials::MaterialTexture
 

Namespaces

namespace  MaterialTemplates
 Materials represent a set of settings and a correlated shader configuration, which tells the engine which shader to use and how to apply the constants and textures on each respective shader.
 
namespace  Materials
 Material special version of variant.
 

Typedefs

typedef IndexT Materials::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 * > Materials::MaterialAllocator
 
typedef Ids::IdAllocator< uintMaterials::MaterialInstanceAllocator
 

Enumerations

enum  {
  Materials::Material_MinLOD , Materials::Material_LODTextures , Materials::Material_Table , Materials::Material_Buffer ,
  Materials::Material_InstanceTables , Materials::Material_InstanceBuffers , Materials::Material_Textures , Materials::Material_Constants ,
  Materials::Material_BufferOffset , Materials::Material_Template
}
 
enum  Materials::MaterialInstanceMembers { Materials::MaterialInstance_Offsets }
 

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.
 
void Materials::MaterialApply (const MaterialId id, const CoreGraphics::CmdBufferId buf, IndexT index)
 Apply 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.
 
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

 Materials::material