|
CeresEngine 0.2.0
A game development framework
|
A class that represents a renderable inside the renderer. More...
#include <CeresEngine/Renderer/RendererRenderable.hpp>
Classes | |
| class | Element |
| The rendering element for the renderable sub-meshes. More... | |
Public Member Functions | |
| RendererRenderable (RendererRenderableManager &manager, RendererScene &scene) | |
| Creates a new RendererRenderable. | |
| ~RendererRenderable () noexcept final | |
| Destroys the renderer renderable and releases any renderer (and RenderAPI)-related resources. | |
| void | synchronize (const Transform &trasnform, const RenderableComponent &component) |
| Update the renderer renderable with data from a transform and the component. | |
| void | prepare (RendererContext &context) |
| Prepares the renderable for the rendering of the current frame. | |
| void | draw (GPUCommandBuffer &commandBuffer, const ConvexVolume *viewFrustum=nullptr) const |
| Submits a draw command for the renderable by automatically binding the index and vertex buffers as required. | |
| void | draw (GPUCommandBuffer &commandBuffer, UInt32 subMeshIndex) const |
Similar to draw(CommandBuffer&) but will only render the specified sub -mesh. | |
| void | drawMeshOnly (GPUCommandBuffer &commandBuffer, const ConvexVolume *viewFrustum=nullptr) const |
| Submits a draw command for the renderable by automatically binding the index and vertex buffers as required. | |
| const RendererRenderableSettings & | getSettings () const |
| const RendererRenderableFlags & | getFlags () const noexcept |
| A set of flags that customize and represent the state of the object. | |
| void | setFlags (const RendererRenderableFlags &flags) |
| A set of flags that customize and represent the state of the object. | |
| const RendererRenderableDirtyFlags & | getDirtyFlags () const noexcept |
| A set of flags that represent the dirty portions of the object. | |
| bool | isDirty () const noexcept |
| void | markAsDirty (const RendererRenderableDirtyFlags &flags=RendererRenderableDirtyFlag::All) noexcept |
| const RendererRenderableInfo & | getInfo () const |
| A structure that holds renderer-specific information for the renderable. | |
| RendererRenderableInfo & | getInfo () |
| A structure that holds renderer-specific information for the renderable. | |
| const Vector< Element > & | getRenderElements () const |
| A vector that holds all render elements for the renderable. | |
| const GPUBindlessBuffer & | getUniformBuffer () const |
| The uniform buffer storing the renderable GPU parameters used by the renderer. | |
| const GPUVertexBuffer & | getVertexBuffer () const |
| const GPUIndexBuffer & | getIndexBuffer () const |
| const RendererMeshPtr & | getRendererMesh () const |
| const HMesh & | getMesh () const |
| Material & | getMaterial () const |
| RendererMaterial & | getRendererMaterial (UInt32 subMesh) const |
| const Vector< SPtr< RendererMaterial > > & | getRendererMaterials () const |
| const AABox & | getBoundingBox () const |
| Gets the renderable bounding box. | |
| const Sphere & | getBoundingSphere () const |
| Gets the renderable bounding sphere. | |
| bool | frustumCull (const ConvexVolume &frustum) const noexcept |
Performs frustum culling using the given camera frustum. | |
| bool | frustumCull (const ConvexVolume &frustum, UInt32 subMeshIndex) const noexcept |
Performs frustum culling on the given subMeshIndex using the given camera frustum. | |
| Generator< RendererGeometry > | enumerateGeometry (const RendererGeometryEnumerationRequest &enumerationRequest=RendererGeometryEnumerationRequest()) const final |
| Enumerates all geometry in the provider. | |
Public Member Functions inherited from CeresEngine::TRendererSceneObject< RendererRenderable > | |
| TRendererSceneObject (Args &&... args) | |
Creates a new TRendererSceneObject instance. | |
| ~TRendererSceneObject () noexcept override | |
Destroys an existing TRendererSceneObject instance. | |
Public Member Functions inherited from CeresEngine::TRendererObject< SelfType, BaseType > | |
| template<typename... Args> | |
| TRendererObject (ManagerType &manager, Args &&... args) | |
Creates a new TRendererObject instance. | |
| void | destroy () noexcept override |
Destroys the RendererObject. | |
| ManagerType & | getManager () const noexcept |
| The owning object manager. | |
Public Member Functions inherited from CeresEngine::RendererObject | |
| RendererObject ()=default | |
Creates a new RendererObject instance. | |
| virtual | ~RendererObject () noexcept=default |
Destroys an existing RendererObject instance. | |
| RendererObjectID | getID () const noexcept |
| An identifier that uniquely identifies this object in the renderer. | |
Public Member Functions inherited from CeresEngine::IRendererGeometryProvider | |
| virtual | ~IRendererGeometryProvider () noexcept=default |
Private Types | |
| using | super = TRendererSceneObject< RendererRenderable > |
Private Member Functions | |
| void | onVertexBufferChanged () |
| void | onIndexBufferChanged () |
Private Attributes | |
| RenderableComponent | mComponent |
| A copy of the latest renderable component. | |
| RendererRenderableFlags | mFlags |
| A set of flags that customize and represent the state of the object. | |
| RendererRenderableDirtyFlags | mDirtyFlags = RendererRenderableDirtyFlag::All |
| A set of flags that represent the dirty portions of the object. | |
| RendererRenderableInfo | mInfo |
| A structure that holds renderer-specific information for the renderable. | |
| RendererRenderableParams | mParameters |
| The GPU parameters. Will be copied to the GPU uniform buffer. | |
| GPUDynamicBindlessBuffer< RendererRenderableParams > | mUniformBuffer |
| The uniform buffer storing the renderable GPU parameters used by the renderer. | |
| RendererMeshPtr | mMesh |
| The renderer mesh. | |
| Vector< SPtr< RendererMaterial > > | mMaterial |
| The material to be used when rendering this renderable. | |
| Vector< Element > | mRenderElements |
| A vector that holds all render elements for the renderable. | |
| Vector< SubMesh > | mSubMeshes |
| A list of submeshes for the renderable. | |
| EventConnection | mOnVertexBufferChangedConnection |
A connection to the renderer mesh onVertexBufferChanged event. | |
| EventConnection | mOnIndexBufferChangedConnection |
A connection to the renderer mesh onIndexBufferChanged event. | |
Friends | |
| class | RendererRenderableManager |
Additional Inherited Members | |
Public Attributes inherited from CeresEngine::RendererObject | |
| Event< void(RendererObjectID newID)> | willChangeID |
| An event called whenever the object is about to change it's ID. | |
| Event< void(RendererObjectID oldID)> | didChangeID |
| An event called whenever the object changes it's ID. | |
Protected Attributes inherited from CeresEngine::TRendererObject< SelfType, BaseType > | |
| ManagerType & | mManager |
| The owning object manager. | |
Protected Attributes inherited from CeresEngine::RendererObject | |
| RendererObjectID | mID |
| An identifier that uniquely identifies this object in the renderer. | |
A class that represents a renderable inside the renderer.
|
explicit |
Creates a new RendererRenderable.
| manager | The owning renderable manager. |
| scene | A reference to the owning scene. |
|
finalnoexcept |
Destroys the renderer renderable and releases any renderer (and RenderAPI)-related resources.
| void CeresEngine::RendererRenderable::draw | ( | GPUCommandBuffer & | commandBuffer, |
| const ConvexVolume * | viewFrustum = nullptr |
||
| ) | const |
Submits a draw command for the renderable by automatically binding the index and vertex buffers as required.
| void CeresEngine::RendererRenderable::draw | ( | GPUCommandBuffer & | commandBuffer, |
| UInt32 | subMeshIndex | ||
| ) | const |
Similar to draw(CommandBuffer&) but will only render the specified sub -mesh.
| void CeresEngine::RendererRenderable::drawMeshOnly | ( | GPUCommandBuffer & | commandBuffer, |
| const ConvexVolume * | viewFrustum = nullptr |
||
| ) | const |
Submits a draw command for the renderable by automatically binding the index and vertex buffers as required.
|
finalvirtual |
Enumerates all geometry in the provider.
Implements CeresEngine::IRendererGeometryProvider.
Performs frustum culling using the given camera frustum.
| frustum | The camera frustum to test visibility for. |
frustum; false otherwise.
|
noexcept |
Performs frustum culling on the given subMeshIndex using the given camera frustum.
| frustum | The camera frustum to test visibility for. |
| subMeshIndex | The index of the sub-mesh to be tested if visible on the camera frustum. |
frustum; false otherwise.
|
inline |
Gets the renderable bounding box.
|
inline |
Gets the renderable bounding sphere.
|
inlinenoexcept |
A set of flags that represent the dirty portions of the object.
|
inlinenoexcept |
A set of flags that customize and represent the state of the object.
| const GPUIndexBuffer & CeresEngine::RendererRenderable::getIndexBuffer | ( | ) | const |
|
inline |
A structure that holds renderer-specific information for the renderable.
|
inline |
A structure that holds renderer-specific information for the renderable.
| Material & CeresEngine::RendererRenderable::getMaterial | ( | ) | const |
A vector that holds all render elements for the renderable.
| RendererMaterial & CeresEngine::RendererRenderable::getRendererMaterial | ( | UInt32 | subMesh | ) | const |
|
inline |
|
inline |
|
inline |
|
inline |
The uniform buffer storing the renderable GPU parameters used by the renderer.
| const GPUVertexBuffer & CeresEngine::RendererRenderable::getVertexBuffer | ( | ) | const |
|
inlinenoexcept |
|
noexcept |
|
private |
|
private |
| void CeresEngine::RendererRenderable::prepare | ( | RendererContext & | context | ) |
Prepares the renderable 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.
| context | A context struct that contains parameters given by the renderer. |
| void CeresEngine::RendererRenderable::setFlags | ( | const RendererRenderableFlags & | flags | ) |
A set of flags that customize and represent the state of the object.
| void CeresEngine::RendererRenderable::synchronize | ( | const Transform & | trasnform, |
| const RenderableComponent & | component | ||
| ) |
Update the renderer renderable with data from a transform and the component.
RenderingSystem during a synchronization point.| transform | The renderable transform. |
| component | The renderable component. |
|
friend |
|
private |
A copy of the latest renderable component.
|
private |
A set of flags that represent the dirty portions of the object.
|
private |
A set of flags that customize and represent the state of the object.
|
private |
A structure that holds renderer-specific information for the renderable.
|
private |
The material to be used when rendering this renderable.
|
private |
The renderer mesh.
|
private |
A connection to the renderer mesh onIndexBufferChanged event.
|
private |
A connection to the renderer mesh onVertexBufferChanged event.
|
private |
The GPU parameters. Will be copied to the GPU uniform buffer.
A vector that holds all render elements for the renderable.
A list of submeshes for the renderable.
|
private |
The uniform buffer storing the renderable GPU parameters used by the renderer.