lights¶
Light sources for Algan’s ray-traced renderer.
Mirrors the Three.js light catalogue: PointLight,
DirectionalLight, AmbientLight, HemisphereLight,
SpotLight and RectAreaLight, each with an intensity
multiplier. Point and spot lights expose artistic decay/distance
falloff controls; rectangular area lights always use physical emission.
Lights use the Mob authoring interface: their location, color, opacity
and intensity are animatable like any other mob attribute. The remaining
parameters (decay, distance, cone angles, emitter sizes) are plain
per-light constants.
Soft (penumbra) shadows: point / spot lights take a shadow_radius (the
world-space radius of the emitting disk) and directional lights a
shadow_angle (angular size, degrees); when non-zero and ray-traced shadows
are enabled (set_shadows())
the deterministic tracer fires a fixed fan of shadow rays across the emitter
instead of a single ray, producing smooth penumbras. RectAreaLight is
sampled at a fixed grid of emitter points (samples), and each row’s fan
integrates visibility over its own cell of the rectangle rather than testing
only the cell’s centre, so its penumbra is continuous rather than a stack of
hard shadows – gated by area_light_soft_shadows, at the ray cost noted on
RectAreaLight.
Both the deterministic fragment-shading route and the path tracer support the
packed extended light types. The deterministic renderer enables fragment
shading when an extended light requires it. Path tracing samples direct light
and can merge rectangular emitters into visible geometry; point, directional
and ambient light objects are not themselves visible meshes. See
raytracing/DESIGN_physical_area_lights.md for emitter geometry and the
legacy distance-falloff convention.
Classes
Uniform, direction-less illumination applied to every surface. |
|
Sun-like light: parallel rays along |
|
Sky/ground gradient ambient: surfaces facing |
|
Base class of all light sources. |
|
Omnidirectional light emitting from a single point. |
|
Emit light from a one-sided rectangular surface. |
|
Cone of light aimed at a target. |
Functions