Log inGet started
Package

screenSpaceGI.package

Newest version

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

README.md

screenSpaceGI

Runtime control of the scene's screen-space bounced light — the surface a quality slider, a cutscene, or a debug toggle drives. The light is the indirect gather of the ambient occlusion pass (@builtin::systems.ambientOcclusion.ao), stated as a strength and a reach.

local screenSpaceGI = require("@builtin::systems.screenSpaceGI.screenSpaceGI")

screenSpaceGI.set({ intensity = 1.0, radius = 2.0, quality = "high" })
screenSpaceGI.get()      -- the settings in force
screenSpaceGI.active()   -- whether the gather is running this frame
screenSpaceGI.clear()    -- off, keeping the rest authored

set lands intensity as the ambient occlusion asset's indirect, and radius and quality (auto, low, medium, high, ultra: the higher levels cost more and read smoother at a strong intensity) as its own, each where it takes effect: as a placed setup's or a component's own value when the application in force states it, else as the asset's live value. It applies the asset when nothing else does, and turns the occlusion beneath the gather on at full strength when it was off. clear puts the occlusion's strength, reach, level and indirect back as they were before set first stated the gather and drops the application this module made; occlusion a placed setup or a component applies keeps running. It is the same pass the AmbientOcclusion component and the ao module state: drive the bounce through one of them.

For a scene that should simply have bounced light, add the ScreenSpaceGI component, or set indirect on the AmbientOcclusion component — both persist with the scene.