Log inGet started
World

Builtin Library

Branchmain
Branchesmainpublish
Commit61a33237e0

README.md

EnvironmentLighting

The sky, as a light source.

local id = entity.spawn("environment").id
entity(id).component.add("EnvironmentLighting", {
    diffuse = 1.0,
    specular = 1.0,
})

Metal reflects what is actually above it instead of a fixed highlight, and matte surfaces pick up the sky's colour in the directions they face. Recolour the sky and the reflections follow, with nothing on this component moving.

The two scales are separate on purpose: an interior wants the sky's diffuse contribution pulled down while its reflections stay, and an exterior often wants the reverse — one number cannot serve both.

Every field is live. Both scales at 0 releases the passes entirely.

For code that changes environment lighting at runtime, reach for @builtin::systems.imageBasedLighting.ibl — same options, no component.

The full description is in the package readme: guides { path = "systems/imageBasedLighting" }.