vkmEngine 1.0.0
A C++ game engine · vkmengine.com
Loading...
Searching...
No Matches
Vkm::Engine::Light Struct Reference

Component representing a light source in the scene. More...

#include <light.h>

Public Attributes

float radius = 10.0f
 Attenuation cutoff (point/spot/area)
float innerConeAngle = 0.5f
 Spot: full-brightness cone, radians.
float outerConeAngle = 0.785f
 Spot: falloff edge, radians.
float areaWidth = 1.0f
 Rect width along the local X axis.
float areaHeight = 1.0f
 Rect height along the local Y axis.
float areaRadius = 0.5f
 Disk radius.
bool twoSided = false
 Area lights: emit from both faces.
float shadowBias = 0.005f
 Depth comparison bias, grown at grazing light.
float shadowNormalBias = 1.5f
 Directional and spot: normal offset before the depth compare, in shadow texels (0..4).
float shadowDistance = 100.0f
 Directional only: world distance the cascades cover.
float sourceRadius = glm::radians(0.5f)
 How large the light's source is, which is how soft its shadows are.

Detailed Description

Component representing a light source in the scene.

Pose comes from the Transform. Area lights emit along -direction (a spot along +direction); their intensity is point-equivalent, so from afar they light like a point light of the same intensity.

Member Data Documentation

◆ shadowBias

float Vkm::Engine::Light::shadowBias = 0.005f

Depth comparison bias, grown at grazing light.

Directional: a cascade depth, scaled with slope. Spot/point: a fraction of the range slid toward the light - twice this at grazing, two fifths head-on.

◆ shadowNormalBias

float Vkm::Engine::Light::shadowNormalBias = 1.5f

Directional and spot: normal offset before the depth compare, in shadow texels (0..4).

Tripled at grazing light. Point lights take none.

◆ sourceRadius

float Vkm::Engine::Light::sourceRadius = glm::radians(0.5f)

How large the light's source is, which is how soft its shadows are.

Directional: angular radius in radians (the sun is about 0.0047), also sizing its highlight. Spot: emitter radius in metres. 0 is hard. Point shadows ignore it; the sky's drawn sun is sized by SkySettings.


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