Vixen
02b45cc4
csharp
public enum LightUnit

What an author's light intensity is measured in.

Read the guide page for this →

Remarks

A light has a physical brightness and a number an author types, and they are not the same thing. A shader wants luminous intensity in candela — that is what divides by the square of the distance — and nobody buys a lamp in candela. A bulb's box says lumens, a light meter reads lux, a screen is specified in nits, and each of those is the natural unit for a different kind of light. So the unit is carried beside the number and the conversion happens once per light per frame, on the way to the GPU.

⚠ Not every unit means something for every kind. Lux is illuminance arriving at a surface, which only a light with no falloff can promise — the sun. Nits is luminance leaving a surface, which needs a light that has a surface. Asking for one that does not apply is not an error: Intensity falls back to the kind's own natural unit, because a light that is off by a factor of 4π is worse than a light that quietly ignored a menu choice.

Fields and properties (5)

  • Native

    Whatever the kind's own unit is, taken as written — candela for a point or a spot, lux for a directional light, nits for an area one.

  • Lumen

    Luminous power, in lumens — what a bulb's packaging says. Point, spot and area.

  • Candela

    Luminous intensity, in candela — what a punctual light's loop wants.

  • Lux

    Illuminance, in lux — a light meter's reading. Directional only.

  • Nits

    Luminance, in nits (cd/m²) — a screen's own brightness. Area lights.

Used by (7)

  • ArenaThirdPersonShooter
  • LightVixen.Rendering
  • PhotometryVixen.Rendering
  • PhotometryTestsVixen.Rendering.Tests
  • RenderLightVixen.Rendering
  • TypeRegistrationVixen.Rendering
  • Vixen_Rendering_Ecs_LightSerializerVixen.Rendering