Log inGet started
World

Builtin Library

Branchmain
Branchesmainpublish
Commitdd348ac6c3

README.md

ssr

Screen-space reflections — polished floors reflect what stands on them, from the frame the engine has already drawn.

local ssr = require("@builtin::systems.reflections.ssr")

ssr.set({ intensity = 1, maxDistance = 40, quality = "high" })
ssr.get()      --> the settings in force
ssr.active()   --> are the reflection passes running
ssr.clear()    --> off, settings kept for the next set()

set takes any subset — omitted fields keep their current value, so adjusting one knob does not mean restating the rest. An intensity of 0 turns reflections off and releases the passes rather than running them at zero strength.

roughnessCutoff is where the reflection starts handing over to the probes and the sky. A surface at or below it takes the full screen-space reflection, one 0.1 above it takes none, and between the two the reflection fades out. The default, 0.75, covers wet asphalt and polished stone.

maxDistance and quality trade against each other. Quality sets how many steps the march spends, so a long distance at a low quality samples coarsely — reflections thin out at range rather than disappearing, because refinement adapts to the step size on its own.

For reflections a scene should simply have, author the ScreenSpaceReflections component instead — it carries the same settings, persists with the scene, and edits live in the inspector. This module is for code that changes reflections at runtime: a quality slider, a cutscene, weather turning pavement wet.

The full description of what each knob does and how the passes work is in the package readme: guides { path = "systems/reflections" }.