GodRaysSettings class Lighting and environment
Directional volumetric god rays (crepuscular rays / light shafts).
A full-screen post-process that marches the view ray against the scene's directional light shadow map, accumulating single-scattering so sunlight streaming through gaps in geometry is visible as shafts. Off by default; set enabled. It requires a shadow-casting DirectionalLight and a PerspectiveCamera (it reads the cascaded shadow map and the camera depth); it is skipped otherwise.
The march is per-pixel and samples the shadow map at every step, so it is a
desktop-leaning effect on mobile/web: keep stepCount low and maxDistance
bounded. See Scene.godRays.
Constructors
Properties
- anisotropy ↔ double
-
Henyey-Greenstein phase asymmetry (
-1to1). Positive concentrates the glow toward the sun (forward scattering);0is uniform.getter/setter pair - color ↔ Vector3
-
The shaft color. This is used directly (not the light's direct radiance),
so shafts show even for a shadow-only sun whose direct intensity is zero;
tint it to match the sun. White by default.
getter/setter pair
- density ↔ double
-
Scattering strength along the ray: how thick and bright the shafts read.
getter/setter pair
- enabled ↔ bool
-
Whether god rays are drawn. Off by default.
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- intensity ↔ double
-
Overall brightness of the in-scattered light.
getter/setter pair
- jitter ↔ double
-
Dither applied to the ray start (in steps) to trade banding for fine
noise.
0disables it.getter/setter pair - maxDistance ↔ double
-
Maximum distance the ray marches, in world units. Bounds the cost and
keeps far pixels from marching the whole depth range.
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- stepCount ↔ int
-
Ray-march steps per pixel. More steps reduce banding at a linear cost;
clamped to
1..64. Pair a low count with jitter.getter/setter pair
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited