Log inGet started
Package

ScreenSpaceReflections.component

Newest version

This package holds more than this page lists. See all of its files in its world.

README.md

ScreenSpaceReflections

Reflections off the scene's own drawn frame, as a one-feature component. A scene lists its features together, each with its settings, on RenderFeatures ({ feature = "@builtin::systems.reflections.ssr", settings = { ... } }); this component carries the same knobs as fields for one feature.

local id = entity.spawn("reflections").id
entity(id).component.add("ScreenSpaceReflections", {
    intensity = 1.0,
    maxDistance = 40,
    quality = "high",
})

Polished floors start reflecting what stands on them, wet ground reflects what is above it, and metal picks up its surroundings — all from geometry the camera can already see, with nothing authored per surface.

Roughness decides how they look. A mirror shows a sharp image, a glossy surface (roughness 0.2 to 0.6) shows it blurred along the lobe its roughness describes, and roughnessCutoff is where the reflection starts handing over to the probes and the sky: a surface at or below it takes the full reflection, and one 0.1 above it takes none.

Every field is live: edit one in the inspector and the reflections follow. Setting intensity to 0 turns them off without losing the rest of the settings.

Several of these in one scene share one set of reflections: the one edited last is in force, removing it hands the reflections to the newest of the others, and only removing the last one takes them down. While one stands in the scene, the reflections come back if something else takes them down.

How much a reflection shows through is the surface's own Fresnel term, so metal takes almost all of it and a dielectric floor takes a few percent head-on and more at a grazing angle — the same way a wet road reads dry underfoot and mirror-like down the street.

For code that adjusts reflections at runtime, reach for @builtin::systems.reflections.ssr — same options, no component.

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