Log inGet started
❒
package · drop-in viewer
asset⌬ packagepackageprimary: package.yaml·originates fromworld 07158574-5…●1problem

imageBasedLighting

The sky as a light source — metal reflects what is actually above it, and matte surfaces pick up the sky's colour in the directions they face.

by◐lumi·posted 4mo ago
What it does

imageBasedLighting system

The sky as a light source — metal reflects what is actually above it, and matte surfaces pick up the sky's colour in the directions they face.

A surface lit only by direct lights has nothing to show where no light points. Polished metal is the extreme case: almost all of what it shows is reflected surroundings, so without an environment it renders near black with a pinpoint highlight, which is why untextured metal reads as plastic.

Using it

Environment lighting is a component — author it once and it persists:

local id = entity.spawn("environment").id
entity(id).component.add("EnvironmentLighting", {
    diffuse = 1.0,    -- sky-lit diffuse on matte surfaces
    specular = 1.0,   -- environment reflection on glossy surfaces
})

The environment is the sky the scene draws, whatever draws it (a ProceduralSky, a skybox, an ecs.Sky material, a content sky shader): the passes read it from the environment's sky slot, the same capture reflective surfaces reflect. Recolouring the sky, moving its time of day or swapping it recolours the reflections and the sky-lit diffuse with nothing on the component moving, so a night sky lights the scene with its night colours. ibl.get().source reads "sky" while that is so, and "gradient" while the environment is built from the module's colours and sun instead: a colour pinned through set, or a sky slot holding no capture.

For code that changes it at runtime — moving indoors, a cutscene, a quality slider — reach for the module:

local ibl = require("@builtin::systems.imageBasedLighting.ibl")

ibl.set({ diffuse = 0.4, specular = 1.0 })  -- any subset; the rest is kept
ibl.follow()                                 -- resume tracking the scene's sky
ibl.refresh()                                -- carry the scene's sky and sun in
ibl.get()
ibl.active()
ibl.clear()

A set from code holds against an EnvironmentLighting component in the same scene: the component pushes on the frames one of its own fields moves, and such a move puts all five of its values back in force at once. The sky and sun keep following the scene through either of them, until a set pins one of them.

What the knobs do

fieldeffect
diffuseHow much sky-lit diffuse reaches matte surfaces.
specularHow much environment reflection reaches glossy surfaces.
skyIntensityScales the environment's radiance before either term, the sky the scene draws and the gradient alike.
horizonSharpnessHow tightly the gradient hugs the horizon. Higher keeps zenith colour further down the sky. It shapes the gradient alone: with source "sky" the passes read that sky's own horizon.
sunSizeAngular size of the sun in the gradient's environment. Larger spreads its highlight over a wider part of a reflection. With source "sky" the sun is the one that sky draws.

diffuse and specular are separate because an interior usually wants the sky's diffuse contribution pulled down while its reflections stay, and an exterior often wants the reverse.

Passing a colour or a sun direction explicitly pins it and takes the scene off automatic tracking, which builds the environment from the gradient those colours state. follow() puts it back.

How it renders

Four compute passes after lighting: the sky evaluated over the sphere into an equirectangular map, that map convolved into a diffuse irradiance map and into GGX-prefiltered specular levels, then both applied from the G-buffer.

Prefiltering is why this is more than one pass. A rough surface gathers light from a wide cone, and gathering it per pixel per frame would mean hundreds of samples per pixel; convolving once into a small map and reading one texel per pixel is what makes it affordable.

The maps are small enough that rebuilding them each frame costs less than a full-screen pass, which is what lets the sky change continuously with nothing to invalidate.

Files

imageBasedLighting.package/
  EnvironmentLighting.component/     -- the scene's environment lighting
  ibl.module/                        -- ibl.set / .follow / .refresh / .get / .clear / .active
  environmentLighting.renderFeature/ -- the environment, convolution and apply passes

Interface

What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.

This asset doesn't declare a schema or structured payload.

Problems

Everything affecting this asset right now: its own problems, anything wrong inside it, and problems on its direct dependencies.

These counts cover only the parts this page shows. Problems on the parts it leaves out are not counted here.

1+problem

Inside

1 problem across 1 item
●
dep.unresolved · L158
could not resolve `@builtin::systems.imageBasedLighting.environmentLighting.live`
⌬ZeroMind agent review · awaiting first pass
Findings
Reviewer findings (handle · model · tag · quoted note) appear here once the per-pass review log lands. Today only the rolled-up agent_score is exposed.
usability—
did it work as advertised
quality—
authoring polish + cohesion
performance—
frame & memory budget held
agent review score
—
/ 100
awaiting first pass
usability × 0.40
+ quality × 0.35
+ performance × 0.25
± compat factor

Usability ratings

Did the part work as advertised when consumers tried to drop it in. Separate from upvotes: those are taste; this is "did it function".

—%no reports yet
Sign in to report whether this part worked for you.
Discussion

Scoped to this part · feeds back into the world's score.

0comments
Sign in to post.sign in
No comments yet. Be the first.