CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
CeresEngine::Renderer Class Reference

The CeresEngine renderer. More...

#include <CeresEngine/Renderer/Renderer.hpp>

Public Member Functions

 Renderer (GPUDevice &device, ResourceManager &resourceManager)
 Creates a new renderer instance that uses the given render API device.
 
 ~Renderer ()
 Destroys the renderer.
 
void render ()
 Renders all cameras in all registered scenes.
 
void render (const RendererView &view)
 Renders a single view.
 
SPtr< RendererMaterialfindMaterial (const HMaterial &material)
 Finds a renderer material for a material resource.
 
RendererShaderPtr getShader (StringView name)
 Finds a shader by name.
 
RendererShaderPtr getOldShader (StringView name)
 Finds a shader by name.
 
RendererScenecreateScene ()
 Registers a new scene entity with the renderer.
 
GPUDevicegetDevice () const noexcept
 The device the renderer will render to.
 
ResourceManagergetResourceManager () const noexcept
 The resource manager to load renderer resources from.
 
const RendererSettingsgetSettings () const noexcept
 Global settings for the renderer.
 
void setSettings (const RendererSettings &rendererSettings)
 Global settings for the renderer.
 
RendererSceneManagergetSceneManager () const noexcept
 The renderer scene manager that is responsible for taking a Scene entity and all manage all it's child entities that are supported by the renderer.
 
RendererCameraManagergetCameraManager () const noexcept
 The renderer mesh manager that is responsible for tracking active Camera entities and maintain a consistent view with RendererCamera.
 
RendererLightManagergetLightManager () const noexcept
 The renderer mesh manager that is responsible for tracking active Light entities and maintain a consistent view with RendererLight.
 
RendererRenderableManagergetRenderableManager () const noexcept
 The renderer mesh manager that is responsible for tracking active Renderable entities and maintain a consistent view with RendererRenderable.
 
RendererTerrainManagergetTerrainManager () const noexcept
 The renderer mesh manager that is responsible for tracking active Terrain entities and maintain a consistent view with RendererTerrain.
 
RendererEnvironmentManagergetEnvironmentManager () const noexcept
 The renderer mesh manager that is responsible for tracking active Environment entities and maintain a consistent view with RendererEnvironment.
 
RendererMeshManagergetMeshManager () const noexcept
 The renderer mesh manager that is responsible for taking a in-engine mesh, convert and upload it to the GPU.
 
RendererTextureManagergetTextureManager () const noexcept
 The renderer texture manager that is responsible for taking a in-engine image, convert and upload it to the GPU.
 
RendererMaterialManagergetMaterialManager () const noexcept
 The renderer material manager that is responsible for taking a material resource and make it usable by the renderer on the GPU.
 
RendererShaderManagergetShaderManager () const noexcept
 The renderer shader manager that is responsible for managing and re-using GPU shaders.
 
RendererGraphicsPipelineManagergetGraphicsPipelineManager () const noexcept
 The renderer graphics pipeline manager that is responsible for managing and re-using GPU graphics pipelines.
 
RendererComputePipelineManagergetComputePipelineManager () const noexcept
 The renderer compute pipeline manager that is responsible for managing and re-using GPU compute pipelines.
 
ShadowRenderergetShadowRenderer () const noexcept
 A renderer that is responsible for drawing shadow maps for lights.
 
Matrix4 getClipMatrix () const
 Returns the clip matrix for the renderer.
 
const GPUImagePtrgetNullTexture () const
 A null cube texture image to be used when one is not necessary.
 
const GPUImagePtrgetNullCubeTexture () const
 A null cube texture image to be used when one is not necessary.
 
const GPUImagePtrgetBRDF () const
 The pre-baked BRDF texture.
 
const GPUPipelineLayoutPtrgetBindlessPipelineLayout () const noexcept
 The bindless pipeline layout.
 
RendererMaterialgetDefaultMaterial () const
 
bool isBindlessSupported () const noexcept
 Checks if bindless rendering is supported by the device.
 
RendererShaderPtr getBasePass ()
 Gets the base pass shader.
 

Private Member Functions

GPUImagePtr generateBRDF (GPUCommandBuffer &commandBuffer)
 Generates the BRDF texture.
 

Private Attributes

GPUDevicemDevice
 The device the renderer will render to.
 
ResourceManagermResourceManager
 The resource manager to load renderer resources from.
 
UPtr< RendererMeshManagermMeshManager
 The renderer mesh manager that is responsible for taking a in-engine mesh, convert and upload it to the GPU.
 
UPtr< RendererTextureManagermTextureManager
 The renderer texture manager that is responsible for taking a in-engine image, convert and upload it to the GPU.
 
UPtr< RendererShaderManagermShaderManager
 The renderer shader manager that is responsible for managing and re-using GPU shaders.
 
UPtr< RendererGraphicsPipelineManagermGraphicsPipelineManager
 The renderer graphics pipeline manager that is responsible for managing and re-using GPU graphics pipelines.
 
UPtr< RendererComputePipelineManagermComputePipelineManager
 The renderer compute pipeline manager that is responsible for managing and re-using GPU compute pipelines.
 
UPtr< RendererMaterialManagermMaterialManager
 The renderer material manager that is responsible for taking a material resource and make it usable by the renderer on the GPU.
 
UPtr< RendererSceneManagermSceneManager
 The renderer scene manager that is responsible for taking a Scene entity and all manage all it's child entities that are supported by the renderer.
 
UPtr< RendererCameraManagermCameraManager
 The renderer mesh manager that is responsible for tracking active Camera entities and maintain a consistent view with RendererCamera.
 
UPtr< RendererLightManagermLightManager
 The renderer mesh manager that is responsible for tracking active Light entities and maintain a consistent view with RendererLight.
 
UPtr< RendererRenderableManagermRenderableManager
 The renderer mesh manager that is responsible for tracking active Renderable entities and maintain a consistent view with RendererRenderable.
 
UPtr< RendererTerrainManagermTerrainManager
 The renderer mesh manager that is responsible for tracking active Terrain entities and maintain a consistent view with RendererTerrain.
 
UPtr< RendererEnvironmentManagermEnvironmentManager
 The renderer mesh manager that is responsible for tracking active Environment entities and maintain a consistent view with RendererEnvironment.
 
UPtr< ShadowRenderermShadowRenderer
 A renderer that is responsible for drawing shadow maps for lights.
 
RendererSettings mSettings
 Global settings for the renderer.
 
HashMap< UInt64, RendererShaderPtrmShaders
 A cache of loaded shaders. Indexed by their shader name hash.
 
GPUImagePtr mNullCubeTexture
 A null cube texture image to be used when one is not necessary.
 
GPUImagePtr mNullTexture
 A null cube texture image to be used when one is not necessary.
 
GPUImagePtr mBRDF
 The pre-baked BRDF texture.
 
GPUPipelineLayoutPtr mBindlessPipelineLayout
 The bindless pipeline layout.
 

Detailed Description

The CeresEngine renderer.

Takes a in-engine Scene object and renders it into texture in the GPU.

Constructor & Destructor Documentation

◆ Renderer()

CeresEngine::Renderer::Renderer ( GPUDevice device,
ResourceManager resourceManager 
)
explicit

Creates a new renderer instance that uses the given render API device.

Parameters
deviceThe device the renderer will render to. Presentation will be done to this device.
resourceManagerThe resource manager to load renderer resources from. Resources such as builtin textures, shaders and meshes will be loaded from this manager.

◆ ~Renderer()

CeresEngine::Renderer::~Renderer ( )

Destroys the renderer.

Member Function Documentation

◆ createScene()

RendererScene & CeresEngine::Renderer::createScene ( )

Registers a new scene entity with the renderer.

Parameters
sceneThe scene to be added to the renderer.

◆ findMaterial()

SPtr< RendererMaterial > CeresEngine::Renderer::findMaterial ( const HMaterial material)

Finds a renderer material for a material resource.

◆ generateBRDF()

GPUImagePtr CeresEngine::Renderer::generateBRDF ( GPUCommandBuffer commandBuffer)
private

Generates the BRDF texture.

This generation is somewhat expensive and the results should be cached as much as possible.

◆ getBasePass()

RendererShaderPtr CeresEngine::Renderer::getBasePass ( )

Gets the base pass shader.

◆ getBindlessPipelineLayout()

const GPUPipelineLayoutPtr & CeresEngine::Renderer::getBindlessPipelineLayout ( ) const
inlinenoexcept

The bindless pipeline layout.

Used by systems to allocate shared resource sets for bindless rendering.

◆ getBRDF()

const GPUImagePtr & CeresEngine::Renderer::getBRDF ( ) const
inline

The pre-baked BRDF texture.

◆ getCameraManager()

RendererCameraManager & CeresEngine::Renderer::getCameraManager ( ) const
inlinenoexcept

The renderer mesh manager that is responsible for tracking active Camera entities and maintain a consistent view with RendererCamera.

◆ getClipMatrix()

Matrix4 CeresEngine::Renderer::getClipMatrix ( ) const

Returns the clip matrix for the renderer.

◆ getComputePipelineManager()

RendererComputePipelineManager & CeresEngine::Renderer::getComputePipelineManager ( ) const
inlinenoexcept

The renderer compute pipeline manager that is responsible for managing and re-using GPU compute pipelines.

◆ getDefaultMaterial()

RendererMaterial & CeresEngine::Renderer::getDefaultMaterial ( ) const

◆ getDevice()

GPUDevice & CeresEngine::Renderer::getDevice ( ) const
inlinenoexcept

The device the renderer will render to.

Presentation will be done to this device.

◆ getEnvironmentManager()

RendererEnvironmentManager & CeresEngine::Renderer::getEnvironmentManager ( ) const
inlinenoexcept

The renderer mesh manager that is responsible for tracking active Environment entities and maintain a consistent view with RendererEnvironment.

◆ getGraphicsPipelineManager()

RendererGraphicsPipelineManager & CeresEngine::Renderer::getGraphicsPipelineManager ( ) const
inlinenoexcept

The renderer graphics pipeline manager that is responsible for managing and re-using GPU graphics pipelines.

◆ getLightManager()

RendererLightManager & CeresEngine::Renderer::getLightManager ( ) const
inlinenoexcept

The renderer mesh manager that is responsible for tracking active Light entities and maintain a consistent view with RendererLight.

◆ getMaterialManager()

RendererMaterialManager & CeresEngine::Renderer::getMaterialManager ( ) const
inlinenoexcept

The renderer material manager that is responsible for taking a material resource and make it usable by the renderer on the GPU.

◆ getMeshManager()

RendererMeshManager & CeresEngine::Renderer::getMeshManager ( ) const
inlinenoexcept

The renderer mesh manager that is responsible for taking a in-engine mesh, convert and upload it to the GPU.

◆ getNullCubeTexture()

const GPUImagePtr & CeresEngine::Renderer::getNullCubeTexture ( ) const
inline

A null cube texture image to be used when one is not necessary.

◆ getNullTexture()

const GPUImagePtr & CeresEngine::Renderer::getNullTexture ( ) const
inline

A null cube texture image to be used when one is not necessary.

◆ getOldShader()

RendererShaderPtr CeresEngine::Renderer::getOldShader ( StringView  name)

Finds a shader by name.

Parameters
nameThe name of the shader to load.
Returns
The renderer shader, if the shader could be found and loaded.

◆ getRenderableManager()

RendererRenderableManager & CeresEngine::Renderer::getRenderableManager ( ) const
inlinenoexcept

The renderer mesh manager that is responsible for tracking active Renderable entities and maintain a consistent view with RendererRenderable.

◆ getResourceManager()

ResourceManager & CeresEngine::Renderer::getResourceManager ( ) const
inlinenoexcept

The resource manager to load renderer resources from.

◆ getSceneManager()

RendererSceneManager & CeresEngine::Renderer::getSceneManager ( ) const
inlinenoexcept

The renderer scene manager that is responsible for taking a Scene entity and all manage all it's child entities that are supported by the renderer.

◆ getSettings()

const RendererSettings & CeresEngine::Renderer::getSettings ( ) const
inlinenoexcept

Global settings for the renderer.

Controls global behavior of the renderer.

◆ getShader()

RendererShaderPtr CeresEngine::Renderer::getShader ( StringView  name)

Finds a shader by name.

Parameters
nameThe name of the shader to load.
Returns
The renderer shader, if the shader could be found and loaded.

◆ getShaderManager()

RendererShaderManager & CeresEngine::Renderer::getShaderManager ( ) const
inlinenoexcept

The renderer shader manager that is responsible for managing and re-using GPU shaders.

◆ getShadowRenderer()

ShadowRenderer & CeresEngine::Renderer::getShadowRenderer ( ) const
inlinenoexcept

A renderer that is responsible for drawing shadow maps for lights.

◆ getTerrainManager()

RendererTerrainManager & CeresEngine::Renderer::getTerrainManager ( ) const
inlinenoexcept

The renderer mesh manager that is responsible for tracking active Terrain entities and maintain a consistent view with RendererTerrain.

◆ getTextureManager()

RendererTextureManager & CeresEngine::Renderer::getTextureManager ( ) const
inlinenoexcept

The renderer texture manager that is responsible for taking a in-engine image, convert and upload it to the GPU.

◆ isBindlessSupported()

bool CeresEngine::Renderer::isBindlessSupported ( ) const
inlinenoexcept

Checks if bindless rendering is supported by the device.

◆ render() [1/2]

void CeresEngine::Renderer::render ( )

Renders all cameras in all registered scenes.

◆ render() [2/2]

void CeresEngine::Renderer::render ( const RendererView view)

Renders a single view.

Parameters
viewThe view to be rendered.

◆ setSettings()

void CeresEngine::Renderer::setSettings ( const RendererSettings rendererSettings)

Global settings for the renderer.

Controls global behavior of the renderer.

Member Data Documentation

◆ mBindlessPipelineLayout

GPUPipelineLayoutPtr CeresEngine::Renderer::mBindlessPipelineLayout
private

The bindless pipeline layout.

Used by systems to allocate shared resource sets for bindless rendering.

◆ mBRDF

GPUImagePtr CeresEngine::Renderer::mBRDF
private

The pre-baked BRDF texture.

◆ mCameraManager

UPtr<RendererCameraManager> CeresEngine::Renderer::mCameraManager
private

The renderer mesh manager that is responsible for tracking active Camera entities and maintain a consistent view with RendererCamera.

◆ mComputePipelineManager

UPtr<RendererComputePipelineManager> CeresEngine::Renderer::mComputePipelineManager
private

The renderer compute pipeline manager that is responsible for managing and re-using GPU compute pipelines.

◆ mDevice

GPUDevice& CeresEngine::Renderer::mDevice
private

The device the renderer will render to.

Presentation will be done to this device.

◆ mEnvironmentManager

UPtr<RendererEnvironmentManager> CeresEngine::Renderer::mEnvironmentManager
private

The renderer mesh manager that is responsible for tracking active Environment entities and maintain a consistent view with RendererEnvironment.

◆ mGraphicsPipelineManager

UPtr<RendererGraphicsPipelineManager> CeresEngine::Renderer::mGraphicsPipelineManager
private

The renderer graphics pipeline manager that is responsible for managing and re-using GPU graphics pipelines.

◆ mLightManager

UPtr<RendererLightManager> CeresEngine::Renderer::mLightManager
private

The renderer mesh manager that is responsible for tracking active Light entities and maintain a consistent view with RendererLight.

◆ mMaterialManager

UPtr<RendererMaterialManager> CeresEngine::Renderer::mMaterialManager
private

The renderer material manager that is responsible for taking a material resource and make it usable by the renderer on the GPU.

◆ mMeshManager

UPtr<RendererMeshManager> CeresEngine::Renderer::mMeshManager
private

The renderer mesh manager that is responsible for taking a in-engine mesh, convert and upload it to the GPU.

◆ mNullCubeTexture

GPUImagePtr CeresEngine::Renderer::mNullCubeTexture
private

A null cube texture image to be used when one is not necessary.

◆ mNullTexture

GPUImagePtr CeresEngine::Renderer::mNullTexture
private

A null cube texture image to be used when one is not necessary.

◆ mRenderableManager

UPtr<RendererRenderableManager> CeresEngine::Renderer::mRenderableManager
private

The renderer mesh manager that is responsible for tracking active Renderable entities and maintain a consistent view with RendererRenderable.

◆ mResourceManager

ResourceManager& CeresEngine::Renderer::mResourceManager
private

The resource manager to load renderer resources from.

◆ mSceneManager

UPtr<RendererSceneManager> CeresEngine::Renderer::mSceneManager
private

The renderer scene manager that is responsible for taking a Scene entity and all manage all it's child entities that are supported by the renderer.

◆ mSettings

RendererSettings CeresEngine::Renderer::mSettings
private

Global settings for the renderer.

Controls global behavior of the renderer.

◆ mShaderManager

UPtr<RendererShaderManager> CeresEngine::Renderer::mShaderManager
private

The renderer shader manager that is responsible for managing and re-using GPU shaders.

◆ mShaders

HashMap<UInt64, RendererShaderPtr> CeresEngine::Renderer::mShaders
private

A cache of loaded shaders. Indexed by their shader name hash.

◆ mShadowRenderer

UPtr<ShadowRenderer> CeresEngine::Renderer::mShadowRenderer
private

A renderer that is responsible for drawing shadow maps for lights.

◆ mTerrainManager

UPtr<RendererTerrainManager> CeresEngine::Renderer::mTerrainManager
private

The renderer mesh manager that is responsible for tracking active Terrain entities and maintain a consistent view with RendererTerrain.

◆ mTextureManager

UPtr<RendererTextureManager> CeresEngine::Renderer::mTextureManager
private

The renderer texture manager that is responsible for taking a in-engine image, convert and upload it to the GPU.


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