66 alignas(16) Vector3f position;
67 alignas(16) Vector3f direction;
70 alignas(16) Matrix4f invTransform;
72 alignas(16) Matrix4f lightSpaceMatrix;
73 alignas(16) Matrix4f invLightSpaceMatrix;
75 alignas(4)
float cutOff;
76 alignas(4)
float outerCutOff;
78 alignas(4)
float constant;
79 alignas(4)
float linear;
80 alignas(4)
float quadratic;
82 alignas(16) Vector3f color;
83 alignas(4)
float strength;
86 alignas(4)
float shadowOcclusionStrength;
89 alignas(4)
float shadowPCFBias;
91 alignas(4)
float shadowPCFSamplingDistance;
#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
A GPU bindless buffer.
Definition GPUBufferObject.hpp:516
Definition GPUCommandBuffer.hpp:77
Definition GPUBufferObject.hpp:562
The CeresEngine renderer.
Definition Renderer.hpp:35
A class that represents a light inside the renderer.
Definition RendererLight.hpp:104
RendererLightInfo mInfo
A structure that holds renderer-specific information for the light.
Definition RendererLight.hpp:123
LightComponent mComponent
A copy of the latest light component.
Definition RendererLight.hpp:110
LightComponent getComponent() const
A copy of the latest light component.
Definition RendererLight.hpp:167
const RendererLightSettings & getSettings() const
Definition RendererLight.hpp:170
RendererLightParams mParameters
The GPU parameters. Will be copied to the GPU uniform buffer.
Definition RendererLight.hpp:126
~RendererLight() noexcept final
Destroys the renderer light and releases any renderer (and RenderAPI)-related resources.
const GPUBindlessBuffer & getUniformBuffer() const
The uniform buffer storing the light GPU parameters used by the renderer.
Definition RendererLight.hpp:194
RendererLightDirtyFlags mDirtyFlags
A set of flags that represent the dirty portions of the object.
Definition RendererLight.hpp:116
const RendererLightInfo & getInfo() const
A structure that holds renderer-specific information for the light.
Definition RendererLight.hpp:188
Sphere getBoundingSphere() const
Gets the renderable bounding sphere.
void synchronize(const Transform &transform, const LightComponent &component)
Update the renderer light with data from a transform and the component.
void renderShadow(GPUCommandBuffer &commandBuffer)
RendererLight(RendererLightManager &manager, RendererScene &scene)
Creates a new RendererLight.
bool mDirty
If set to true, the light is dirty and needs to be synchronized from the entity.
Definition RendererLight.hpp:120
void setShadowMap(const GPUImagePtr &shadowMap)
A device image that holds the rendered shadow map.
RendererLightFlags mFlags
A set of flags that customize and represent the state of the object.
Definition RendererLight.hpp:113
void markAsDirty(const RendererLightDirtyFlags &flags=RendererLightDirtyFlag::All) noexcept
If set to true, the light is dirty and needs to be synchronized from the entity.
void prepare(RendererContext &context)
Prepares the light for the rendering of the current frame.
bool isDirty() const noexcept
If set to true, the light is dirty and needs to be synchronized from the entity.
Definition RendererLight.hpp:182
GPUDynamicBindlessBuffer< RendererLightParams > mUniformBuffer
The uniform buffer storing the light GPU parameters used by the renderer.
Definition RendererLight.hpp:129
void setFlags(const RendererLightFlags &flags)
A set of flags that customize and represent the state of the object.
GPUImagePtr mShadowMap
A device image that holds the rendered shadow map.
Definition RendererLight.hpp:132
const RendererLightFlags & getFlags() const noexcept
A set of flags that customize and represent the state of the object.
Definition RendererLight.hpp:173
const RendererLightDirtyFlags & getDirtyFlags() const noexcept
A set of flags that represent the dirty portions of the object.
Definition RendererLight.hpp:179
const GPUImagePtr & getShadowMap() const
A device image that holds the rendered shadow map.
Definition RendererLight.hpp:200
RendererLightInfo & getInfo()
A structure that holds renderer-specific information for the light.
Definition RendererLight.hpp:191
A manager that controls all lights currently registered with the renderer.
Definition RendererLight.hpp:208
void markAsDirty(RendererLight *const light)
Marks the given light as dirty.
UniformBufferType mUniformBuffer
The uniform buffer storing all light GPU parameters used by the renderer.
Definition RendererLight.hpp:221
~RendererLightManager() noexcept final
Destroys the RendererLightManager and releases all lights objects managed by it.
Vector< UPtr< RendererLight > > mLights
A vector of all registered lights.
Definition RendererLight.hpp:217
Async renderShadows(RendererContext &context)
RendererLightManager(Renderer &renderer)
Creates a new instance of the RendererLightManager.
Async prepare(RendererContext &context)
Prepares the lights 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
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
RendererLightDirtyFlag
Flags that can be either set by the renderer or by the user to customize the behavior of the mesh.
Definition RendererLight.hpp:38
@ None
Special value that represents a clean (i.e. non-dirty) object.
@ All
Special value that represents a dirty object with all parts dirty.
@ 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.
auto transform(Container &container, Transform &&transform)
Returns an iterable object that iterates over the values of the container and applies transform to ev...
Definition Iterator.hpp:436
RendererLightFlag
Flags that can be either set by the renderer or by the user to customize the behavior of the light.
Definition RendererLight.hpp:29
constexpr size_t hash(const T &v)
Generates a hash for the provided type.
Definition Hash.hpp:25
Components serve as the base for data storage for an entity.
Definition Component.hpp:68
A scene light.
Definition Light.hpp:58
RendererLightSettings rendererSettings
A set of settings that should be used by renderer when rendering the light.
Definition Light.hpp:115
A structure that contains context given by the renderer to render it's objects.
Definition Renderer.hpp:252
A structure that holds renderer-specific information for the light.
Definition RendererLight.hpp:95
Matrix4 lightSpaceMatrix
The latest light space matrix used by the renderer.
Definition RendererLight.hpp:100
bool needsShadowMapUpdate
If true, indicates that the light needs a shadow map update pass.
Definition RendererLight.hpp:97
A structure that mirrors the GPU uniform data for the light.
Definition RendererLight.hpp:63
A structure that holds renderer-specific settings for a Light.
Definition RendererLightSettings.hpp:150