CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
CeresEngine::RendererMaterial Class Referenceabstract

An abstract class that represents a renderer material. More...

#include <CeresEngine/Renderer/RendererMaterial.hpp>

Inheritance diagram for CeresEngine::RendererMaterial:
CeresEngine::RendererMaterialPBR

Public Member Functions

 RendererMaterial (RendererMaterialManager &manager)
 Creates a new renderer material.
 
virtual ~RendererMaterial ()=default
 Virtual defaulted destructor.
 
virtual void prepare (RendererContext &context)=0
 Prepares the material for the rendering of the current frame.
 
virtual void fillResourceSetDescriptor (GPUShaderResourceSetBindings &bindings) const =0
 Fills a ReflectedResourceSetDescriptor with the material parameters.
 
virtual const GPUShaderProgramPtrgetShaderProgram () const =0
 Gets the shader program used by the material.
 
virtual const GPUUniformBuffergetUniformBuffer () const =0
 Returns the uniform buffer that holds material parameters.
 
virtual const GPUResourceSetPtrgetResourceSet () const =0
 Returns the ResourceSet that holds material parameters.
 
virtual GPUResourceSetDescriptor getResourceSetDescriptor () const =0
 Returns the ResourceSet bindings that holds material parameters.
 
UInt32 getID () const noexcept
 A unique ID that can be used to uniquely identify the material in the bindless material resource set.
 
bool isDirty () const noexcept
 
void markAsDirty () noexcept
 
virtual void bind (GPUCommandBuffer &commandBuffer)=0
 

Protected Attributes

RendererMaterialManagermManager
 The material manager that owns and manages this material instance.
 
RenderermRenderer
 The renderer that owns the material.
 
UInt32 mID = ~0u
 A unique ID that can be used to uniquely identify the material in the bindless material resource set.
 
bool mDirty = true
 

Private Member Functions

void setID (const UInt32 id) noexcept
 A unique ID that can be used to uniquely identify the material in the bindless material resource set.
 

Friends

class RendererMaterialManager
 

Detailed Description

An abstract class that represents a renderer material.

Constructor & Destructor Documentation

◆ RendererMaterial()

CeresEngine::RendererMaterial::RendererMaterial ( RendererMaterialManager manager)
explicit

Creates a new renderer material.

◆ ~RendererMaterial()

virtual CeresEngine::RendererMaterial::~RendererMaterial ( )
virtualdefault

Virtual defaulted destructor.

Member Function Documentation

◆ bind()

virtual void CeresEngine::RendererMaterial::bind ( GPUCommandBuffer commandBuffer)
pure virtual

◆ fillResourceSetDescriptor()

virtual void CeresEngine::RendererMaterial::fillResourceSetDescriptor ( GPUShaderResourceSetBindings bindings) const
pure virtual

Fills a ReflectedResourceSetDescriptor with the material parameters.

The parameters are filled by name.

Parameters
bindingsThe bindings to be filled with material parameters.

Implemented in CeresEngine::RendererMaterialPBR.

◆ getID()

UInt32 CeresEngine::RendererMaterial::getID ( ) const
inlinenoexcept

A unique ID that can be used to uniquely identify the material in the bindless material resource set.

◆ getResourceSet()

virtual const GPUResourceSetPtr & CeresEngine::RendererMaterial::getResourceSet ( ) const
pure virtual

Returns the ResourceSet that holds material parameters.

Implemented in CeresEngine::RendererMaterialPBR.

◆ getResourceSetDescriptor()

virtual GPUResourceSetDescriptor CeresEngine::RendererMaterial::getResourceSetDescriptor ( ) const
pure virtual

Returns the ResourceSet bindings that holds material parameters.

Implemented in CeresEngine::RendererMaterialPBR.

◆ getShaderProgram()

virtual const GPUShaderProgramPtr & CeresEngine::RendererMaterial::getShaderProgram ( ) const
pure virtual

Gets the shader program used by the material.

Implemented in CeresEngine::RendererMaterialPBR.

◆ getUniformBuffer()

virtual const GPUUniformBuffer & CeresEngine::RendererMaterial::getUniformBuffer ( ) const
pure virtual

Returns the uniform buffer that holds material parameters.

Implemented in CeresEngine::RendererMaterialPBR.

◆ isDirty()

bool CeresEngine::RendererMaterial::isDirty ( ) const
inlinenoexcept

◆ markAsDirty()

void CeresEngine::RendererMaterial::markAsDirty ( )
inlinenoexcept

◆ prepare()

virtual void CeresEngine::RendererMaterial::prepare ( RendererContext context)
pure virtual

Prepares the material for the rendering of the current frame.

This will update uniform buffers and perform any other necessary operations necessary for rendering. All prepared data must be view independent.

Parameters
contextA context struct that contains parameters given by the renderer.

Implemented in CeresEngine::RendererMaterialPBR.

◆ setID()

void CeresEngine::RendererMaterial::setID ( const UInt32  id)
inlineprivatenoexcept

A unique ID that can be used to uniquely identify the material in the bindless material resource set.

Friends And Related Symbol Documentation

◆ RendererMaterialManager

Member Data Documentation

◆ mDirty

bool CeresEngine::RendererMaterial::mDirty = true
protected

◆ mID

UInt32 CeresEngine::RendererMaterial::mID = ~0u
protected

A unique ID that can be used to uniquely identify the material in the bindless material resource set.

◆ mManager

RendererMaterialManager& CeresEngine::RendererMaterial::mManager
protected

The material manager that owns and manages this material instance.

◆ mRenderer

Renderer& CeresEngine::RendererMaterial::mRenderer
protected

The renderer that owns the material.


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