69 alignas(16) Vector3f position;
71 alignas(16) Matrix4f model;
72 alignas(16) Matrix4f invModel;
74 alignas(16) Matrix4f normalMatrix;
75 alignas(16) Matrix4f invNormalMatrix;
#define CE_FLAGS_OPERATORS(Enum)
Defines global operators for a Flags<Enum, Storage> implementation.
Definition Flags.hpp:216
#define CE_DECL_RENDERER_OBJECT(T)
Definition RendererObject.hpp:25
A retain-release type of smart pointer.
Definition SmartPtr.hpp:132
Scoped connection class.
Definition Event.hpp:104
A GPU bindless buffer.
Definition GPUBufferObject.hpp:516
Definition GPUCommandBuffer.hpp:77
Definition GPUBufferObject.hpp:562
Definition GPUBufferObject.hpp:169
Definition GPUBufferObject.hpp:126
A generator represents a coroutine type that produces a sequence of values of type T,...
Definition Generator.hpp:50
An interface that must be implemented by systems that provide RendererElement instances for rendering...
Definition RendererGeometry.hpp:56
A graphics material to be used when rendering objects in a scene.
Definition Material.hpp:21
A element (usually a sub-mesh) visible on the screen.
Definition RendererRendering.hpp:18
The CeresEngine renderer.
Definition Renderer.hpp:35
An abstract class that represents a renderer material.
Definition RendererMaterial.hpp:31
The rendering element for the renderable sub-meshes.
Definition RendererRenderable.hpp:261
const GPUIndexBuffer & getIndexBuffer() const noexcept final
Definition RendererRenderable.hpp:288
const RendererMaterial & getMaterial() const noexcept final
The material for the render element.
Sphere getBoundingSphere() const final
Gets the renderable bounding sphere.
Definition RendererRenderable.hpp:297
UInt32 mSubMeshIndex
The sub-mesh index for the renderable element.
Definition RendererRenderable.hpp:270
RendererRenderable & mRenderable
The owning renderable object.
Definition RendererRenderable.hpp:264
Element(RendererRenderable &renderable, const SubMesh &subMesh, UInt32 subMeshIndex)
SubMesh mSubMesh
The sub-mesh for the renderable element.
Definition RendererRenderable.hpp:267
A class that represents a renderable inside the renderer.
Definition RendererRenderable.hpp:95
const RendererMeshPtr & getRendererMesh() const
Definition RendererRenderable.hpp:218
GPUDynamicBindlessBuffer< RendererRenderableParams > mUniformBuffer
The uniform buffer storing the renderable GPU parameters used by the renderer.
Definition RendererRenderable.hpp:119
const RendererRenderableDirtyFlags & getDirtyFlags() const noexcept
A set of flags that represent the dirty portions of the object.
Definition RendererRenderable.hpp:192
EventConnection mOnIndexBufferChangedConnection
A connection to the renderer mesh onIndexBufferChanged event.
Definition RendererRenderable.hpp:138
~RendererRenderable() noexcept final
Destroys the renderer renderable and releases any renderer (and RenderAPI)-related resources.
RendererRenderableInfo & getInfo()
A structure that holds renderer-specific information for the renderable.
Definition RendererRenderable.hpp:204
const RendererRenderableFlags & getFlags() const noexcept
A set of flags that customize and represent the state of the object.
Definition RendererRenderable.hpp:186
const Vector< SPtr< RendererMaterial > > & getRendererMaterials() const
Definition RendererRenderable.hpp:223
const RendererRenderableSettings & getSettings() const
Definition RendererRenderable.hpp:183
const Sphere & getBoundingSphere() const
Gets the renderable bounding sphere.
Definition RendererRenderable.hpp:229
bool frustumCull(const ConvexVolume &frustum) const noexcept
Performs frustum culling using the given camera frustum.
void setFlags(const RendererRenderableFlags &flags)
A set of flags that customize and represent the state of the object.
RenderableComponent mComponent
A copy of the latest renderable component.
Definition RendererRenderable.hpp:104
bool frustumCull(const ConvexVolume &frustum, UInt32 subMeshIndex) const noexcept
Performs frustum culling on the given subMeshIndex using the given camera frustum.
RendererMaterial & getRendererMaterial(UInt32 subMesh) const
Vector< SPtr< RendererMaterial > > mMaterial
The material to be used when rendering this renderable.
Definition RendererRenderable.hpp:125
void prepare(RendererContext &context)
Prepares the renderable for the rendering of the current frame.
const Vector< Element > & getRenderElements() const
A vector that holds all render elements for the renderable.
Definition RendererRenderable.hpp:207
Vector< SubMesh > mSubMeshes
A list of submeshes for the renderable.
Definition RendererRenderable.hpp:131
void synchronize(const Transform &trasnform, const RenderableComponent &component)
Update the renderer renderable with data from a transform and the component.
RendererRenderableInfo mInfo
A structure that holds renderer-specific information for the renderable.
Definition RendererRenderable.hpp:113
Vector< Element > mRenderElements
A vector that holds all render elements for the renderable.
Definition RendererRenderable.hpp:128
void markAsDirty(const RendererRenderableDirtyFlags &flags=RendererRenderableDirtyFlag::All) noexcept
const GPUBindlessBuffer & getUniformBuffer() const
The uniform buffer storing the renderable GPU parameters used by the renderer.
Definition RendererRenderable.hpp:210
bool isDirty() const noexcept
Definition RendererRenderable.hpp:195
EventConnection mOnVertexBufferChangedConnection
A connection to the renderer mesh onVertexBufferChanged event.
Definition RendererRenderable.hpp:135
RendererRenderableParams mParameters
The GPU parameters. Will be copied to the GPU uniform buffer.
Definition RendererRenderable.hpp:116
Generator< RendererGeometry > enumerateGeometry(const RendererGeometryEnumerationRequest &enumerationRequest=RendererGeometryEnumerationRequest()) const final
Enumerates all geometry in the provider.
const RendererRenderableInfo & getInfo() const
A structure that holds renderer-specific information for the renderable.
Definition RendererRenderable.hpp:201
const HMesh & getMesh() const
Definition RendererRenderable.hpp:219
RendererRenderable(RendererRenderableManager &manager, RendererScene &scene)
Creates a new RendererRenderable.
void onVertexBufferChanged()
const GPUVertexBuffer & getVertexBuffer() const
const AABox & getBoundingBox() const
Gets the renderable bounding box.
Definition RendererRenderable.hpp:226
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 re...
RendererMeshPtr mMesh
The renderer mesh.
Definition RendererRenderable.hpp:122
RendererRenderableDirtyFlags mDirtyFlags
A set of flags that represent the dirty portions of the object.
Definition RendererRenderable.hpp:110
void onIndexBufferChanged()
RendererRenderableFlags mFlags
A set of flags that customize and represent the state of the object.
Definition RendererRenderable.hpp:107
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 re...
const GPUIndexBuffer & getIndexBuffer() const
Material & getMaterial() const
A manager that controls all renderables currently registered with the renderer.
Definition RendererRenderable.hpp:303
RendererRenderableManager(Renderer &renderer)
Creates a new instance of the RendererRenderableManager.
HashSet< RendererRenderable * > mDirtyRenderables
A set of dirty renderables that need to be updated on the next frame.
Definition RendererRenderable.hpp:316
void markAsDirty(RendererRenderable *const renderable)
Marks the given renderable as dirty.
~RendererRenderableManager() noexcept final
Destroys the RendererRenderableManager and releases all renderables objects managed by it.
Vector< UPtr< RendererRenderable > > mRenderables
A vector of all registered renderables.
Definition RendererRenderable.hpp:312
UniformBufferType mUniformBuffer
The uniform buffer that holds GPU parameters for all renderables.
Definition RendererRenderable.hpp:320
Async prepare(RendererContext &context)
Prepares the renderables for the rendering of the current frame.
A class that represents a scene inside the renderer.
Definition RendererScene.hpp:34
Template class to help implement sub-classes of RendererSceneObject.
Definition RendererSceneObject.hpp:47
Template class to help implement sub-classes of RendererSceneObjectManager.
Definition RendererSceneObject.hpp:81
Definition Application.hpp:19
RendererRenderableFlag
Flags that can be either set by the renderer or by the user to customize the behavior of the renderab...
Definition RendererRenderable.hpp:32
cti::continuable< Args... > Async
Defines a non-copyable continuation type which uses the function2 backend for type erasure.
Definition Async.hpp:22
std::vector< T, ScopedAllocatorAdaptor< StdAllocator< T, RawAllocator > > > Vector
Vector is a sequence container that encapsulates dynamic size arrays.
Definition Vector.hpp:17
@ UniformBuffer
Uniform buffer (or constant buffer) resource.
std::uint32_t UInt32
Definition DataTypes.hpp:23
@ Transform
Indicates that the object transform is dirty.
@ All
Specifies all shader stages.
std::unordered_set< Key, Hash, KeyEqual, ScopedAllocatorAdaptor< StdAllocator< Key, RawAllocator > > > HashSet
HashSet is an associative container that contains a set of unique objects of type Key.
Definition Set.hpp:30
constexpr size_t hash(const T &v)
Generates a hash for the provided type.
Definition Hash.hpp:25
RendererRenderableDirtyFlag
Flags that can be either set by the renderer or by the user to customize the behavior of the mesh.
Definition RendererRenderable.hpp:41
@ None
Special value that represents a clean (i.e. non-dirty) object.
@ All
Special value that represents a dirty object with all parts dirty.
Components serve as the base for data storage for an entity.
Definition Component.hpp:68
A component that represents an object that can be rendered by a renderer.
Definition Renderable.hpp:30
RendererRenderableSettings rendererSettings
A set of settings that should be used by renderer when rendering the renderable.
Definition Renderable.hpp:42
HMesh mesh
The mesh to render the component with.
Definition Renderable.hpp:35
A structure that contains context given by the renderer to render it's objects.
Definition Renderer.hpp:252
Parameters to customize a geometry enumeration request.
Definition RendererGeometry.hpp:47
A structure that holds renderer-specific information for the renderable.
Definition RendererRenderable.hpp:79
Matrix4 model
Transformation matrices for the object model and it's inverse.
Definition RendererRenderable.hpp:81
Sphere boundingSphere
The renderable bounding sphere in world-space.
Definition RendererRenderable.hpp:91
AABox boundingBox
The renderable bounding box in world-space.
Definition RendererRenderable.hpp:87
Matrix4 invModel
Definition RendererRenderable.hpp:81
Matrix3 normalMatrix
Definition RendererRenderable.hpp:83
Matrix3 invNormalMatrix
Definition RendererRenderable.hpp:83
A structure that mirrors the GPU uniform data for the renderable.
Definition RendererRenderable.hpp:66
A structure that holds renderer-specific settings for a Renderable.
Definition RendererRenderableSettings.hpp:15
AABox boundingBox
The sub-mesh axis-aligned bounding box, can be used to perform culling.
Definition Mesh.hpp:82
Sphere boundingSphere
The sub-mesh bounding sphere, can be used to perform culling.
Definition Mesh.hpp:79