Nebula
Loading...
Searching...
No Matches
Decals::DecalContext Class Reference

#include <decalcontext.h>

Inherits Graphics::GraphicsContext.

Public Member Functions

 DecalContext ()
 constructor
 
virtual ~DecalContext ()
 destructor
 
- Public Member Functions inherited from Graphics::GraphicsContext
 GraphicsContext ()
 constructor
 
virtual ~GraphicsContext ()
 destructor
 

Static Public Member Functions

static void Create ()
 setup decal context
 
static void Discard ()
 discard decal context
 
static void SetupDecalPBR (const Graphics::GraphicsEntityId id, const Math::mat4 transform, const Resources::ResourceId albedo, const Resources::ResourceId normal, const Resources::ResourceId material)
 setup as albedo-normal-material decal
 
static void SetupDecalEmissive (const Graphics::GraphicsEntityId id, const Math::mat4 transform, const Resources::ResourceId emissive)
 setup as emissive decal
 
static void SetAlbedoTexture (const Graphics::GraphicsEntityId id, const Resources::ResourceId albedo)
 set albedo texture for a PBR decal
 
static void SetNormalTexture (const Graphics::GraphicsEntityId id, const Resources::ResourceId normal)
 set normal texture for a PBR decal
 
static void SetMaterialTexture (const Graphics::GraphicsEntityId id, const Resources::ResourceId material)
 set material texture for a PBR decal
 
static void SetEmissiveTexture (const Graphics::GraphicsEntityId id, const Resources::ResourceId emissive)
 set emissive texture for a PBR decal
 
static void SetTransform (const Graphics::GraphicsEntityId id, const Math::mat4 transform)
 set transform of decal
 
static Math::mat4 GetTransform (const Graphics::GraphicsEntityId id)
 get transform of decal
 
static void UpdateViewDependentResources (const Ptr< Graphics::View > &view, const Graphics::FrameContext &ctx)
 update view dependent resources
 
static void OnRenderDebug (uint32_t flags)
 render debug
 

Private Types

enum  DecalType { PBRDecal , EmissiveDecal }
 
enum  { Decal_Transform , Decal_Type , Decal_TypedId }
 
enum  { DecalPBR_Albedo , DecalPBR_Normal , DecalPBR_Material }
 
enum  { DecalEmissive_Emissive }
 
typedef Ids::IdAllocator< Math::mat4, DecalType, Ids::Id32GenericDecalAllocator
 
typedef Ids::IdAllocator< Resources::ResourceId, Resources::ResourceId, Resources::ResourceId > PBRDecalAllocator
 
typedef Ids::IdAllocator< Resources::ResourceId > EmissiveDecalAllocator
 

Private Member Functions

 __DeclareContext ()
 

Static Private Member Functions

static Graphics::ContextEntityId Alloc ()
 allocate a new slice for this context
 
static void Dealloc (Graphics::ContextEntityId id)
 deallocate a slice
 

Static Private Attributes

static GenericDecalAllocator genericDecalAllocator
 
static PBRDecalAllocator pbrDecalAllocator
 
static EmissiveDecalAllocator emissiveDecalAllocator
 

Additional Inherited Members

- Static Protected Member Functions inherited from Graphics::GraphicsContext
static void InternalRegisterEntity (const Graphics::GraphicsEntityId id, Graphics::GraphicsContextState &&state)
 
static void InternalDeregisterEntity (const Graphics::GraphicsEntityId id, Graphics::GraphicsContextState &&state)
 
template<class ID_ALLOCATOR >
static void InternalDefragment (ID_ALLOCATOR &allocator, Graphics::GraphicsContextState &&state)
 

Member Typedef Documentation

◆ EmissiveDecalAllocator

◆ GenericDecalAllocator

◆ PBRDecalAllocator

Ids::IdAllocator< Resources::ResourceId, Resources::ResourceId, Resources::ResourceId > Decals::DecalContext::PBRDecalAllocator
private

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
private
Enumerator
Decal_Transform 
Decal_Type 
Decal_TypedId 

◆ anonymous enum

anonymous enum
private
Enumerator
DecalPBR_Albedo 
DecalPBR_Normal 
DecalPBR_Material 

◆ anonymous enum

anonymous enum
private
Enumerator
DecalEmissive_Emissive 

◆ DecalType

Enumerator
PBRDecal 
EmissiveDecal 

Constructor & Destructor Documentation

◆ DecalContext()

Decals::DecalContext::DecalContext ( )

constructor

◆ ~DecalContext()

Decals::DecalContext::~DecalContext ( )
virtual

destructor

Member Function Documentation

◆ __DeclareContext()

Decals::DecalContext::__DeclareContext ( )
private

◆ Alloc()

Graphics::ContextEntityId Decals::DecalContext::Alloc ( )
staticprivate

allocate a new slice for this context

◆ Create()

void Decals::DecalContext::Create ( )
static

setup decal context

◆ Dealloc()

void Decals::DecalContext::Dealloc ( Graphics::ContextEntityId id)
staticprivate

deallocate a slice

◆ Discard()

void Decals::DecalContext::Discard ( )
static

discard decal context

◆ GetTransform()

Math::mat4 Decals::DecalContext::GetTransform ( const Graphics::GraphicsEntityId id)
static

get transform of decal

◆ OnRenderDebug()

void Decals::DecalContext::OnRenderDebug ( uint32_t flags)
static

render debug

Todo: Right now, we just render a box, but probably we want some type of mesh to illustrate this is a decal, and not some 'empty' object.

◆ SetAlbedoTexture()

void Decals::DecalContext::SetAlbedoTexture ( const Graphics::GraphicsEntityId id,
const Resources::ResourceId albedo )
static

set albedo texture for a PBR decal

◆ SetEmissiveTexture()

void Decals::DecalContext::SetEmissiveTexture ( const Graphics::GraphicsEntityId id,
const Resources::ResourceId emissive )
static

set emissive texture for a PBR decal

◆ SetMaterialTexture()

void Decals::DecalContext::SetMaterialTexture ( const Graphics::GraphicsEntityId id,
const Resources::ResourceId material )
static

set material texture for a PBR decal

◆ SetNormalTexture()

void Decals::DecalContext::SetNormalTexture ( const Graphics::GraphicsEntityId id,
const Resources::ResourceId normal )
static

set normal texture for a PBR decal

◆ SetTransform()

void Decals::DecalContext::SetTransform ( const Graphics::GraphicsEntityId id,
const Math::mat4 transform )
static

set transform of decal

◆ SetupDecalEmissive()

void Decals::DecalContext::SetupDecalEmissive ( const Graphics::GraphicsEntityId id,
const Math::mat4 transform,
const Resources::ResourceId emissive )
static

setup as emissive decal

◆ SetupDecalPBR()

void Decals::DecalContext::SetupDecalPBR ( const Graphics::GraphicsEntityId id,
const Math::mat4 transform,
const Resources::ResourceId albedo,
const Resources::ResourceId normal,
const Resources::ResourceId material )
static

setup as albedo-normal-material decal

◆ UpdateViewDependentResources()

void Decals::DecalContext::UpdateViewDependentResources ( const Ptr< Graphics::View > & view,
const Graphics::FrameContext & ctx )
static

update view dependent resources

Member Data Documentation

◆ emissiveDecalAllocator

DecalContext::EmissiveDecalAllocator Decals::DecalContext::emissiveDecalAllocator
staticprivate

◆ genericDecalAllocator

DecalContext::GenericDecalAllocator Decals::DecalContext::genericDecalAllocator
staticprivate

◆ pbrDecalAllocator

DecalContext::PBRDecalAllocator Decals::DecalContext::pbrDecalAllocator
staticprivate

The documentation for this class was generated from the following files: