public static class PhotometryColour temperature, luminous units, and the exposure that brings them back to a display.
Remarks
Why a renderer needs any of this. A scene lit in arbitrary multipliers is one where every value has to be retuned when anything changes: move the sun down and the lamps are suddenly wrong, add a lamp and the sun is. Physical units remove the coupling — a 2700 K lantern emitting 600 lumens is that lantern under a noon sky and under a sunset, and what changes between the two is the exposure, which is one number for the whole frame.
Everything here is photometric, not radiometric. The pipeline's "radiance" is luminance in cd/m², the sun's intensity is illuminance in lux, and the tonemap divides by a middle-grey exposure derived from an EV. That is the same choice Unity's HDRP and Frostbite make, and the reason is that photometric units are the ones instruments and datasheets are written in: a radiometric pipeline needs a spectral response curve before anyone can say what a 60 W bulb is.
Free functions on values rather than methods on a light, because the sky needs the same arithmetic and is not a light — see PhysicalSky.
Fields and properties (3)
public const float MiddleGreyThe reflectance the exposure equation is anchored to — the 12.5 of a reflected-light meter.
public const float MinimumTemperatureThe lowest temperature the locus approximation is valid at, in kelvin.
public const float MaximumTemperatureThe highest temperature the locus approximation is valid at, in kelvin.
Methods (8)
public static Color3 FromTemperature(float kelvin)The colour of a black body at a temperature, as linear sRGB of unit luminance.
public static Color3 WhiteBalance(float kelvin, float tint)What to multiply a frame by so a given illuminant renders as white.
public static float Intensity(LightKind kind, LightUnit unit, float intensity, float outerAngle = 0, float radius = 0, float halfLength = 0)What one light's authored intensity is in the unit the GPU record wants.
public static float ConeSolidAngle(float halfAngle)The solid angle of a cone of a given half-angle, in steradians.
public static float CapsuleArea(float radius, float halfLength)The surface area of a capsule: a cylinder's side plus a sphere's worth of caps.
public static float ExposureFromEv100(float ev100)The linear multiplier that takes a scene's luminance to display-referred values.
public static float Ev100FromExposure(float exposure)The exposure value a linear multiplier corresponds to.
public static float Ev100FromCamera(float aperture, float shutterTime, float sensitivity)The exposure value a photographic camera's three settings give.
Used by (8)
- LocalExposureRendererVixen.Rendering.PostFx
- PhotometryTestsVixen.Rendering.Tests
- PhysicalCameraTestsVixen.Rendering.Tests
- PostEffectFactoryVixen.Rendering.PostFx
- PostEffectTestsVixen.Rendering.PostFx.Tests
- RenderLightVixen.Rendering
- TonemapRendererVixen.Rendering.PostFx
- WhiteBalanceTestsVixen.Rendering.Tests