Log inGet started
Package

debanding.module

Newest version

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

README.md

debanding

The API behind the Debanding component. Use it directly when the settings are driven by script rather than authored on an entity.

local Deband = require("@builtin::systems.debanding.debanding")

Deband.enable()                                   -- on at full strength
Deband.set({ threshold = 3, radius = 16 })        -- any omitted field is kept
local s = Deband.get()                            -- a copy of the settings
Deband.active()                                   -- is the pass running?
Deband.disable()                                  -- off, and the pass released

The module owns the settings, packs them into the deband_params buffer the pass reads, and ties the feature's lifetime to whether debanding is on. At zero strength the pass is released, so a scene that is not debanding pays nothing and renders exactly as it would without the package.

threshold and grain are given in eight-bit code values because that is the unit banding is measured in — see the package readme for what the pass does with them. A grain above 1 registers an even film grain, the debanding.grain post-process effect (@builtin::systems.lensFx.filmGrain), for the depth the output stage's one-code dither leaves.