API Reference · Lights

Light

Namespace: Ava3D

public abstract class Light

What every light has in common. Put concrete lights — DirectionalLight, PointLight and SpotLight — in Scene.Lights.

Properties

MemberDescription
bool CastsShadows { get; set; }

Whether geometry blocks this light. False by default, and false on every light in a scene that does not ask.

Scene.MaxShadowedLights sets the budget (one by default, at most two). Larger Light.ShadowPriority wins; ties keep scene order so camera motion cannot reshuffle lights. Scene.ShadowCastingLights reports the selection. A backend without enough sampler capacity retains the one-light tier and reports that limitation.

Each kind casts through the frustum its own geometry implies. A DirectionalLight gets an orthographic box fitted to what casts; a SpotLight gets its own cone; a PointLight has no direction at all, so it gets six faces of a cube and shadows in every direction. See Scene.ShadowCasters for narrowing what goes into any of them, Scene.ShadowMapSize for the budget, and Scene.ShadowsEnabled for the switch that turns the whole feature off without disturbing either.

Vector3 Color { get; set; }

Linear RGB of the light. Multiplied by Light.Intensity.

float Intensity { get; set; }

Overall brightness. Separate from Light.Color so a light's hue and its strength can be tuned independently, which is how authored scenes describe them.

Nullable<BoundingBox> ShadowCasterBounds { get; set; }

Optional world-space bounds of this light's shadow casters. Meshes outside are skipped and directional projection is fitted to the intersection with scene caster bounds. Include all geometry that can block this light. Null uses Scene.ShadowCasters and its full bounds.

int ShadowPriority { get; set; }

Priority within Scene.MaxShadowedLights. Higher wins; equal priorities keep scene order. After changing light properties on a displayed static scene, call Ava3DView.InvalidateScene.

See also