Dynamic Ray

The DynamicRayLayer creates animated, stylized light rays that respond to sun direction and camera angle. This layer is ideal for simulating sunbeams, magical energy rays, or sci-fi scanning effects. It inherits all fading and variation options from StaticRayLayer.

Common Uses:

  • Sun shafts breaking through clouds or windows

  • Magical spell beams or energy rays

  • Stylized sci-fi scanning or spotlight effects

Variables

Name
Type
Description

rayLength

float

Maximum distance each ray will travel.

bidirectional

bool

If true, rays are cast both forward and backward from the mesh surface.

angleOpacityEffect

float

How much the angle between the sun direction and the ray’s forward vector affects opacity (0–1).

angleRaylengthEffect

float

How much the angle between the sun direction and the ray’s forward vector affects ray length (0–1).

autoAssignSun

bool

Automatically assign the primary directional light as the sun.

useLumenSunScript

bool

Use a custom script to control the Lumen sun behavior.

sunDirection

Vector3

World-space direction of the simulated sun.

Inherits all fading and variation options from StaticRayLayer.

Example:

  • Use DynamicRayLayer for a magical portal that emits swirling, animated rays.

  • Add to a window to create animated god rays that move as the sun moves.

Last updated