public struct RenderLightOne light as a host authors it: physical units, angles in radians, colour separate from intensity.
No guide page documents this yet — the page shows what the code says about itself.
Remarks
Deliberately not the layout the GPU reads. An author sets a colour and an intensity and a cone half-angle; a shader wants a premultiplied radiance and the cosine of that angle. Keeping the two apart means the trigonometry happens once per light per frame rather than once per light per fragment, and it means changing the GPU record's packing does not change what a scene file says.
Radius is a sphere-light radius rather than a falloff distance: it widens the specular highlight instead of the reach. Range is the reach.
Fields and properties (15)
public LightKind KindWhich kind of light this is.
public Vector3 PositionWhere it is. Unused by a directional light.
public Vector3 DirectionWhich way it points, away from the light. Unused by a point light.
public Color3 ColourIts colour, before intensity and before Temperature.
public float IntensityHow bright it is, in Unit.
public LightUnit UnitWhat Intensity is measured in.
public float TemperatureIts colour temperature in kelvin, or zero to use Colour alone.
public float RangeThe distance at which its contribution reaches zero.
public float RadiusIts sphere radius. Zero for a punctual light.
public float InnerAngleThe inner cone half-angle in radians, inside which a spot is at full brightness.
public float OuterAngleThe outer cone half-angle in radians, outside which a spot contributes nothing.
public Vector3 TangentA shaped light's own axis: along a tube, or across a rectangle's width.
public float HalfLengthHalf a tube's length, or half a rectangle's width. Zero for a punctual light.
public int ShadowTileWhich tile of the frame's punctual shadow atlas shadows it, counted from one. Zero is none.
public readonly Vector3 RadianceWhat the shader multiplies: the tinted colour times the converted intensity.
Methods (6)
public static RenderLight Directional(Vector3 direction, Color3 colour, float intensity = 1)A directional light, which needs no position and no range.
public static RenderLight Point(Vector3 position, float range, Color3 colour, float intensity = 1)A point light.
public static RenderLight Spot(Vector3 position, Vector3 direction, float range, float innerAngle, float outerAngle, Color3 colour, float intensity = 1)A spot light, with half-angles in radians.
public static RenderLight Tube(Vector3 position, Vector3 axis, float halfLength, float radius, float range, Color3 colour, float intensity = 1)A tube light: a segment of a given radius, lit along its whole length.
public static RenderLight Rect(Vector3 position, Vector3 normal, Vector3 axis, float halfWidth, float halfHeight, float range, Color3 colour, float intensity = 1)A rectangular panel, emitting from one face.
public readonly PunctualLightData ToGpu()This light in the layout the shader reads.
Used by (25)
- ArenaThirdPersonShooter
- BufferTransferDeviceTestsVixen.Graphics.Golden.Tests
- ClusterCullingDeviceTestsVixen.Graphics.Golden.Tests
- ClusteredLightingTestsVixen.Rendering.Tests
- ClusteredShadingDeviceTestsVixen.Graphics.Golden.Tests
- ForwardFrameTestsVixen.Rendering.Tests
- ForwardLightingRenderFeatureVixen.Rendering
- ForwardLightingTestsVixen.Rendering.Tests
- IPunctualLightSourceVixen.Rendering
- ISunSourceVixen.Rendering
- LightExtractionSystemVixen.Rendering
- LightExtractionTestsVixen.Rendering.Tests
- ObjectRecordTestsVixen.Rendering.Tests
- ParticleLightTestsVixen.Rendering.Tests
- ParticleLightsVixen.Rendering
- PhotometryTestsVixen.Rendering.Tests
- PunctualShadowRendererVixen.Rendering
- PunctualShadowTestsVixen.Rendering.Tests
- SceneLightingVixen.Rendering
- SceneLightingTestsVixen.Rendering.Tests
- ShadowMapRendererVixen.Rendering
- ShadowMapRendererTestsVixen.Rendering.Tests
- SunlightVixen.Rendering.Tests
- SunlightVixen.Rendering.Tests
- VirtualShadowRendererVixen.Rendering