limitLight

beta
filter
limitLight
RayTK
v0.42

Limits the brightness of a light using distance attenuation or a bounding SDF (or both).

Attenuation makes the light full brightness at the position of the light and after a distance it tapers off to darkness.

Bounding SDFs do something similar but instead of using distance from the light source, they use an SDF that defines an area within which the light is at full brightness.

The optimization feature tells the renderer that in places where attentuation / bounding says the light should be totally off, the renderer can skip attempting to use that light at all for any materials there.

Parameters

Name Description Regular Handling Read-Only Handling
Enable
Enable Attenuation

Whether to use distance from the light source to dim the light.

Runtime Baked
Attenuation Distance

Range within which the light is at full brightness.

Runtime Baked
Attenuation Fade

Width of the transition from light to dark for distance attenuation. This fading is centered on the range from the distance parameter, so half the fade will be inside that range and half will be extending beyond that range.

Runtime Baked
Enable Bounds

Whether to use an SDF to dim the light outside an area.

Runtime Baked
Bounds Offset

Expands or shrinks the bounding area from the SDF, equivalent to inserting a round operator between the SDF and the limitLight.

Runtime Baked
Bounds Blending

Width of the transition from light to dark from the bounding SDF.

Runtime Baked
Optimize Outside

Whether to tell the renderer it can skip material calculations for the light in areas outside the attenuation / bounding SDF.

Runtime Baked

Inputs

  • Light: (required) Light whose brightness is to be limited.
    • Coordinate Types: float vec2 vec3 vec4
    • Context Types: LightContext
    • Return Types: Light
  • Bounds SDF: (optional) SDF that defines an area for the light to be at full brightness.
    • Coordinate Types: float vec2 vec3 vec4
    • Context Types: LightContext
    • Return Types: Sdf