Log inGet started
Package

ibl.module

Newest version

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

README.md

ibl

Image-based lighting from the scene's own sky.

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

ibl.set({ diffuse = 1, specular = 1 })
ibl.follow()    -- go back to reading the scene's sky after pinning values
ibl.get()       --> the settings in force
ibl.active()    --> are the passes running
ibl.clear()     --> off, settings kept for the next set()

set takes any subset. With both diffuse and specular at 0 nothing is being asked for and the passes are released.

The sky's colours and the sun are read from the scene, so recolouring the sky recolours what metal reflects. Passing any colour or direction explicitly pins it and takes the scene off automatic tracking for that value; follow() puts it back.

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

For environment lighting a scene should simply have, author the EnvironmentLighting component instead. This module is for code that changes it at runtime: moving indoors, a cutscene, a quality slider.

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