Expand description
Shader functions for the lighting system.
Directional lights are in lux, spot and point lights are in candelas. Conversion happens in the PBR shader during radiance accumulation.
More info is here https://www.realtimerendering.com/blog/physical-units-for-lights.
§Note
The glTF spec 1 says directional light is in lux, whereas spot and point are in candelas. The same goes for this library’s shaders, but not a ton of work has gone into verifying that conversion from these units into radiometric units is accurate in any way. The shaders roughly do a conversion by dividing by 683 2 or some other constant involving 683 3.
More work needs to be done here. PRs would be very appreciated.
Structs§
- Candela
- A unit of luminous intensity, lumen per steradian (lm/sr).
- Directional
Light Descriptor - Light
Descriptor - A generic light that is used as a slab pointer to a specific light type.
- Light
Tile - A tile of screen space used to cull lights.
- Light
Tiling Descriptor - Descriptor of the light tiling operation, which culls lights by accumulating them into lists that illuminate tiles of the screen.
- Lighting
Descriptor - Lux
- A unit of illuminance, lumen per meter squared (lm/m^2).
- Point
Light Descriptor - Shadow
Calculation - Parameters to the shadow mapping calculation function.
- Shadow
MapDescriptor - Spot
Light Calculation - Contains values needed to determine the outgoing radiance of a fragment.
- Spot
Light Descriptor - Description of a spot light.
Enums§
Functions§
- dequantize_
depth_ u32_ to_ f32 - Reconstructs a previously quantized depth from a
u32
. - light_
tiling_ bin_ lights - light_
tiling_ clear_ tiles - light_
tiling_ compute_ tile_ min_ and_ max_ depth - Compute the min and max depth value for a tile.
- light_
tiling_ compute_ tile_ min_ and_ max_ depth_ multisampled - Compute the min and max depth value for a tile, multisampled.
- light_
tiling_ depth_ pre_ pass - Depth pre-pass for the light tiling feature.
- quantize_
depth_ f32_ to_ u32 - Quantizes a fragment depth from
f32
tou32
. - radius_
of_ illumination - Returns the radius of illumination in meters.
- shadow_
mapping_ fragment - shadow_
mapping_ vertex - Shadow mapping vertex shader.