CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
CeresEngine::LightComponent Struct Referencefinal

A scene light. More...

#include <CeresEngine/Scene/Light.hpp>

Inheritance diagram for CeresEngine::LightComponent:
CeresEngine::Component< LightComponent > CeresEngine::AbstractComponent

Classes

struct  Accessor
 A scene light. More...
 

Public Member Functions

virtual CE_DISABLE_WARNING_MISSING_OVERRIDE ::CeresEngine::ClassInfo getClassInfo () const noexcept
 
virtual ::CeresEngine::ClassInfo getClassInfo () noexcept
 
 LightComponent ()=default
 Creates a new LightComponent with the default values.
 
- Public Member Functions inherited from CeresEngine::Component< LightComponent >
const ComponentTypegetComponentType () const noexcept final
 Gets the component type.
 
- Public Member Functions inherited from CeresEngine::AbstractComponent
virtual ~AbstractComponent ()=default
 Defaulted virtual destructor.
 

Static Public Member Functions

template<typename Processor >
static constexpr void reflect (Processor &&RTTI)
 Executes the given processor for every field of the struct.
 

Public Attributes

LightType type = LightType::Point
 The light type.
 
Vector3 color = Vector3(1.0)
 The light ambient color.
 
double power = 1.0
 Power of the light in Watts.
 
double radius = 1.0
 When larger than zero, light will be emitted from a spherical surfaces with the specified radius.
 
double strength = 1.0
 The light strength.
 
bool shouldCastShadows = false
 A flag that indicates if the light should cast shadows.
 
double shadowOcclusionStrength = 1.0
 A constant that control the shadow occlusion strength.
 
double constant = 0.0
 The point light constant attenuation constant.
 
double linear = 0.0
 The point light linear attenuation constant.
 
double quadratic = 1.0
 The point light quadratic attenuation constant.
 
double cutOff = 10.0
 The spot light cutoff angle.
 
double outerCutOff = 15.0
 The spot light outer cutoff angle.
 
RendererLightSettings rendererSettings
 A set of settings that should be used by renderer when rendering the light.
 

Additional Inherited Members

- Static Public Attributes inherited from CeresEngine::Component< LightComponent >
static const ComponentID componentID
 This component type ID.
 
static const ComponentMask mask
 The component mask.
 
static const ComponentTypecomponentType
 Gets the component type.
 

Detailed Description

A scene light.

of Lights

The power of sun lights is specified in Watts per square meter. The power of point lights, spot lights, and area lights is specified in Watts. But this is not the electrical Watts that consumer light bulbs are rated at. It is Radiant Flux or Radiant Power which is also measured in Watts. It is the energy radiated from the light in the form of visible light.

If you want to set the power to real world values, you have to convert the wattage of consumer bulbs or LED lights to radiant flux, but it is not a straightforward process. The wattage of bulbs means the electrical power required to power them. LED lights have a “Watt equivalent” which is neither the electrical power they require nor the amount of light they put out. Some consumer lights specify lumens or luminous flux which is the radiant flux weighted with the wavelengths perceived by the human eye.

Constructor & Destructor Documentation

◆ LightComponent()

CeresEngine::LightComponent::LightComponent ( )
default

Creates a new LightComponent with the default values.

Member Function Documentation

◆ getClassInfo() [1/2]

virtual CE_DISABLE_WARNING_MISSING_OVERRIDE ::CeresEngine::ClassInfo CeresEngine::LightComponent::getClassInfo ( ) const
virtualnoexcept

Reimplemented from CeresEngine::AbstractComponent.

◆ getClassInfo() [2/2]

virtual ::CeresEngine::ClassInfo CeresEngine::LightComponent::getClassInfo ( )
virtualnoexcept

Reimplemented from CeresEngine::AbstractComponent.

◆ reflect()

template<typename Processor >
static constexpr void CeresEngine::LightComponent::reflect ( Processor &&  RTTI)
inlinestaticconstexpr

Executes the given processor for every field of the struct.

Parameters
RTTIThe processor to be ran for every field.

Member Data Documentation

◆ color

Vector3 CeresEngine::LightComponent::color = Vector3(1.0)

The light ambient color.

◆ constant

double CeresEngine::LightComponent::constant = 0.0

The point light constant attenuation constant.

◆ cutOff

double CeresEngine::LightComponent::cutOff = 10.0

The spot light cutoff angle.

◆ linear

double CeresEngine::LightComponent::linear = 0.0

The point light linear attenuation constant.

◆ outerCutOff

double CeresEngine::LightComponent::outerCutOff = 15.0

The spot light outer cutoff angle.

◆ power

double CeresEngine::LightComponent::power = 1.0

Power of the light in Watts.

Higher values increase the intensity of the light. Negative values can be set, but should be avoided for predictable and physically based result.

◆ quadratic

double CeresEngine::LightComponent::quadratic = 1.0

The point light quadratic attenuation constant.

◆ radius

double CeresEngine::LightComponent::radius = 1.0

When larger than zero, light will be emitted from a spherical surfaces with the specified radius.

Lights with larger size have softer shadows and specular highlights, and they will also appear dimmer because their power is distributed over a larger area.

◆ rendererSettings

RendererLightSettings CeresEngine::LightComponent::rendererSettings

A set of settings that should be used by renderer when rendering the light.

◆ shadowOcclusionStrength

double CeresEngine::LightComponent::shadowOcclusionStrength = 1.0

A constant that control the shadow occlusion strength.

◆ shouldCastShadows

bool CeresEngine::LightComponent::shouldCastShadows = false

A flag that indicates if the light should cast shadows.

◆ strength

double CeresEngine::LightComponent::strength = 1.0

The light strength.

◆ type

LightType CeresEngine::LightComponent::type = LightType::Point

The light type.


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