3#include "../../EntityPtr.h"
5#include "Foundation/Geometry/Glm.hpp"
38 enum class LightingLayers : uint32_t
45 ENABLE_ENUM_FLAGS(LightingLayers);
47 enum class ShadowUpdate
57 enum class SoftShadows
138 hashValue = Component::hash(hashValue);
164template<>
inline Cogs::StringView getName<Cogs::Core::LightComponent>() {
return "LightComponent"; }
166template<>
inline Cogs::StringView getName<Cogs::Core::LightType>() {
return "LightType"; }
167template<>
inline Cogs::StringView getName<Cogs::Core::LightingLayers>() {
return "LightingLayers"; }
168template<>
inline Cogs::StringView getName<Cogs::Core::ShadowUpdate>() {
return "ShadowUpdate"; }
169template<>
inline Cogs::StringView getName<Cogs::Core::SoftShadows>() {
return "SoftShadows"; }
Base class for Component instances.
Defines a single light source and its behavior.
LightType lightType
The type of light.
float shadowBias
Constant term shadow map rasterization bias.
bool mainLight
If this light is the main light of the application.
bool castShadows
If this light should cast shadows.
bool enabled
If the light is enabled.
float shadowBiasClamp
Shadow map bias rasterization clamp.
static void registerType()
Register the type in the type system.
float intensity
Intensity of the light source.
float shadowNearPlane
Shadow near plane. If set to 0 near plane is 1/1000th of the radius.
float shadowSampleBias
Constant term shadow map sampling bias.
std::vector< WeakEntityPtr > cameras
Cameras from which the shadow maps will be used, defaults to main camera.
WeakEntityPtr lodReference
Camera entity of which its z-axis define the shadowmap cascade split axis, defaults to main camera.
float shadowSlopedBias
Linear term of shadow map rasterization bias.
float shadowIntensityOffset
Shadow intensity offset.
bool tightShadowBounds
If the shadows should have tight bounds.
glm::vec4 lightColor
Color contribution of the light.
bool dynamicCascadeCount
Dynamically determine how many cascades should be drawn.
LightingLayers lightingLayer
The lighting layer the light belongs to.
float _shadowNormalOffsetBias
Shadow normal bias.
float range
Falloff range.
Provides a weakly referenced view over the contents of a string.
std::weak_ptr< ComponentModel::Entity > WeakEntityPtr
Weak Smart pointer for Entity access.
LightType
Defines light types.
@ Point
Point light source.
@ Directional
Directional light.
Contains all Cogs related functionality.
constexpr size_t hash() noexcept
Simple getter function that returns the initial value for fnv1a hashing.