8#include "ecs/component/render/light.h"
10namespace Vkm::Engine {
74inline const LightData* lowestSlotDirectional(
const std::vector<LightData>& lights) {
77 if (light.type != LightType::Directional)
continue;
91inline const LightData* lowestSlotDirectionalCaster(
const std::vector<LightData>& lights) {
92 const LightData* sun =
nullptr;
93 for (
const LightData& light : lights) {
94 if (light.type != LightType::Directional || !light.castShadows)
continue;
95 if (!sun || light.entitySlot < sun->entitySlot) sun = &light;
One light affecting the frame, resolved to world space.
Definition light_data.h:18
bool transient
Definition light_data.h:62
float shadowNormalBias
See Light::shadowNormalBias.
Definition light_data.h:48
glm::vec3 axisU
Rect/Disk: half-right world axis.
Definition light_data.h:42
int shadowPriority
See Light::shadowPriority.
Definition light_data.h:50
float radius
Attenuation radius (point/spot/area)
Definition light_data.h:36
float shadowBias
See Light::shadowBias.
Definition light_data.h:47
float innerConeAngle
Spot: full-brightness cone (radians)
Definition light_data.h:38
float shadowDistance
Directional only: world distance the cascades cover.
Definition light_data.h:49
bool twoSided
Rect/Disk: emit from both faces.
Definition light_data.h:44
uint32_t entitySlot
The entity slot this light was gathered from.
Definition light_data.h:28
glm::vec3 axisV
Rect/Disk: half-up world axis.
Definition light_data.h:43
float outerConeAngle
Spot: falloff edge (radians)
Definition light_data.h:39
float sourceRadius
Light::sourceRadius: radians for a directional light, metres otherwise.
Definition light_data.h:58
glm::vec3 direction
Travel direction; used by directional/spot.
Definition light_data.h:34
float wave
The share of intensity it shines with this frame (flickerWave)
Definition light_data.h:31