Lysa  0.0
Lysa 3D Engine
Light Struct Reference

Detailed Description

A Light resource

+ Inheritance diagram for Light:

Public Member Functions

float3 getGlobalPosition () const
 
float3 getFrontVector () const
 
 Light (const LightType type, const float3 &color={1.0f}, const float intensity=1.0f, const float4x4 &transform=float4x4::identity (), const float range=10.0f, const float cutOff=1.3, const float outerCutOff=1.4, const bool castShadows=false, const uint32 shadowMapSize=1024)
 
LightData getData () const
 
- Public Member Functions inherited from UnmanagedResource
 UnmanagedResource ()
 
 UnmanagedResource (const Resource &other)
 
- Public Member Functions inherited from Resource
bool operator== (const Resource &other) const
 
 Resource () = default
 
 Resource (const unique_id id)
 
virtual ~Resource () = default
 

Public Attributes

LightType type
 
float3 color
 
float intensity
 
float4x4 transform
 
float range
 
float cutOff
 
float outerCutOff
 
bool castShadows
 
uint32 shadowMapSize
 
bool visible {true}
 
float shadowMapNearClipDistance {0.01f}
 
uint32 shadowMapCascadesCount {3}
 
float shadowMapCascadesSplitLambda {.85f}
 
float shadowTransparencyScissors {0.25f}
 
float shadowTransparencyColorScissors {0.75f}
 
- Public Attributes inherited from Resource
unique_id id {INVALID_ID}
 

Constructor & Destructor Documentation

Light ( const LightType  type,
const float3 &  color = {1.0f},
const float  intensity = 1.0f,
const float4x4 &  transform = float4x4::identity(),
const float  range = 10.0f,
const float  cutOff = 1.3,
const float  outerCutOff = 1.4,
const bool  castShadows = false,
const uint32  shadowMapSize = 1024 
)
inline

Constructor

Parameters
typeThe light type
colorThe light color
intensityThe light intensity
transformThe world space transform
rangeThe light range
cutOffThe inner cut-off angle in radians
outerCutOffThe outer cut-off angle in radians
castShadowsWhether the light casts shadows
shadowMapSizeThe resolution of the shadow map

Member Function Documentation

LightData getData ( ) const
inline

Returns the light data for GPU consumption

float3 getFrontVector ( ) const
inline

Returns the light front (direction) vector

float3 getGlobalPosition ( ) const
inline

Returns the light position in world space

Member Data Documentation

bool castShadows

Whether the light casts shadows

float3 color

Light color (RGB)

float cutOff

Inner cut-off angle in radians

float intensity

Light intensity

float outerCutOff

Outer cut-off angle in radians

float range

Light range

uint32 shadowMapCascadesCount {3}

Number of cascades for directional shadow maps

float shadowMapCascadesSplitLambda {.85f}

Lambda factor for cascade splitting

float shadowMapNearClipDistance {0.01f}

Shadow map near clip distance

uint32 shadowMapSize

Resolution of the shadow map

float shadowTransparencyColorScissors {0.75f}

Color scissors factor for shadow transparency

float shadowTransparencyScissors {0.25f}

Scissors factor for shadow transparency

float4x4 transform

World space transform

LightType type

Light type

bool visible {true}

Whether the light is visible/active