API Reference · Lights

PointLight

Namespace: Ava3D

public sealed class PointLight : Light

A light at a position, falling off with distance. A lamp, a flare, a headlight on the camera.

The falloff matches three.js exactly, so tuning carries across from a scene authored there:

attenuation = pow(saturate(1 − pow(d / Range, 4)), 2) / max(pow(d, Decay), 0.01)
with the windowing term dropped when PointLight.Range is zero.

Properties

MemberDescription
float Decay { get; set; }

Falloff exponent: 1 is roughly linear, 2 is physical inverse-square.

Vector3 Position { get; set; }

Where the light is, in world space.

float Range { get; set; }

Distance at which the light reaches exactly zero. Zero means unbounded inverse-square.

Worth setting on anything that shares a scene with distant geometry: an unbounded light still contributes a little at any distance, and "a little" across a planet-sized surface is a night side that is not dark.

See also