postprocess
Fullscreen post-process effects — register / remove / toggle / named-property updates / list the chain / read one effect's declared property schema and the value each property holds.
require("@builtin::modules.api.engine.postprocess") -- postprocess (also available as global 'postprocess')
The postprocess namespace: 20 functions.
globals/postprocess/add
postprocess.add(name: string, shader: string | AssetRef, opts: PostprocessOpts?) -> (boolean, string?)
Register a fullscreen post-process effect. This call is what
puts a pass into the frame — a post-process .shader asset defines an
effect, and renders only once registered here. The chain applies the
registration on the caller's own stack and the returned boolean is its
answer, so a setProperty or setTexture naming the effect in the same
call finds it. shader is a .shader asset reference whose shader.wgsl
provides fn fragment(in: PostInput) -> vec4<f32> and whose
properties.yaml declares the effect's properties; the engine generates the
group(0) framework + schema-driven group(1) from that schema. Editing that
shader afterwards recompiles this effect in place, keeping its enabled
state, priority, layer and tuned property values. Registering again under
a name the chain already holds puts this registration in that effect's
place and keeps each value setProperty wrote into it for a property this
registration declares and takes that value for, and each texture
setTexture bound to a slot it declares; postprocess.remove before the
registration starts the effect from its defaults. WGSL text is accepted
in place of a shader reference, and then opts.properties is the whole
schema — this form is deprecated and will be removed, author the effect
as a .shader asset instead. The chain effects of one stage run in
priority order (lower first, default 100); priority = "last" runs the
effect after every numbered chain effect of its stage, and chain effects
sharing a priority (two "last" among them) run in the order they
registered; a priority of 0 or below runs first. A render feature's
passes of the stage run where renderer.post.stages() lists them: in
ui, an afterPost pass runs after every chain effect.
A priority of 4294967295 or above, and any other string, is refused with
the range.
A registered effect runs over the live viewport's frame AND over every
offscreen one — a capture from a world-space station, one orbiting an
entity, one of a named camera, a render-to-texture camera. A texture
camera's picture reaches the screen through the frame that shows it, so an
all-layer effect runs there, over the texture along with the rest of the
interface, and once: the camera's own render runs the scene and display
layers, and the all layer too only with textureColorSpace = "presented"
(a capture's camera, which reads its texture back as the finished frame;
see the Camera component). In each of those
the effect's engine.view_proj / engine.prev_view_proj /
engine.inv_view_proj are the camera THAT render was drawn from and
engine.resolution is that target's own size, so a pass reconstructing
world space from zero_scene_depth(uv) reconstructs against the station
and lens the capture asked for. An offscreen capture is therefore an oracle
for an authored grade: it photographs a chosen station without taking the
on-screen camera from whoever else is driving the scene, and a capture's
postProcessing = false is the one control that takes the chain off the
frame it returns. An offscreen render keeps no view history of its own, so
engine.prev_view_proj there holds that same matrix rather than the frame
before it, and a pass taking camera motion from the two reads none.
Parameters
namestring— Unique effect name.shaderstring | AssetRef— A resolvedshaderasset reference, or author WGSL (fn fragment(in: PostInput)only).optsPostprocessOpts(optional) —{ priority = 100 | "last", enabled = true, stage = "optics"|"display"|"ui", layer = "scene"|"display"|"all" (omitted: follows stage, else space), space = "light"|"display", properties = {{name, type, default?, min?, max?, textureDefault?}}, passes = {{name, entry, scale?, inputs?}} }— with a shader asset,propertieslayers over the asset's own schema.stagenames the post stage of the frame the effect runs in (renderer.post.stages()lists them):"optics"runs it before the display transform, over the scene's light;"display"after the display transform and before the UI, over code values;"ui"after the UI. With a shader asset it defaults to thestage:the asset declares. A stage the frame does not have, or one only render features run in, is refused with the stages there are.layerpicks which composited image the effect grades:"scene"runs it before the UI is drawn, over the scene's own light in a float target, so it grades the rendered picture and leaves every widget on screen as authored;"display"runs it before the UI is drawn too, over the picture the display transform fitted to the screen, and leaves every widget as authored; and"all"runs it after the UI has landed, over that picture, so the interface is graded along with the picture. A call that names neither takes the layer itsspacebelongs to: a"light"effect grades"scene"and a"display"effect grades"display", so a bloom reads the scene's highlights where they still stand above 1.0 and a lookup table reads code values. Naming"all"is what an effect that must grade the interface says — and on a world several authors share, it grades everyone else's screens too.spacenames whatfragment()reads and returns:"light"(the default) for a threshold/blur/grade on the scene,"display"for a lookup table, dither ladder or authored overlay working on code values. With a shader asset, defaults to what that asset'sgetSpace()declares.passesnames the passes the effect draws, each an entry in the shader, a fraction of the view it draws at, and what it reads. With a shader asset, defaults to what that asset'sgetPasses()declares; a single-pass effect (the common case) declares none.textureDefaultis what atype = "texture"property samples while nothing is bound to it:"white"(1,1,1,1 — the default),"black"(0,0,0,1),"normal"(0.5,0.5,1,1) or"transparent"(0,0,0,0). An effect that lays its texture over the scene wants"transparent", so the frame is untouched untilsetTexturebinds a texture that exists.
Returns (boolean, string?) — True when the chain took the effect; false and the compiler's message when it refused it. A shader that does not compile draws nothing at any property value, so it is not registered and postprocess.list() never names it. __display__, __output__ and __blit__ are the renderer's own effects, and a registration under any of them is refused with a message saying so. A call made from inside queue() or batch(), where the engine has not run the registration by the time the call returns, answers true for the queued request.
postprocess.add("vignette", asset.resolve("@builtin::shaders.post.vignette", "shader"))
postprocess.add("vignette", VIGNETTE_WGSL, { properties = {{ name = "intensity", type = "float", default = 0.5 }} })
globals/postprocess/describe
postprocess.describe(name: string) -> PostprocessDescription?
One effect by name, read in full: the chain state
postprocess.status() lists for it, and on top of that properties — the
schema the effect declared, each entry { name, type, default?, min?, max?, textureDefault?, options? } in the shape add takes — and values, what
each of those properties currently holds. A property's value is the one
the last setProperty wrote, or the schema's own default where nothing
has written one, and it comes back as a number for a scalar, as the array
for a wider value, and as the option's name for a property with
options (__display__'s curve reads "agx"), which is what
setProperty takes, so a property read here is written straight back.
This is the read-back for a property write. setProperty answers whether
the uniform took the value; this answers what the effect holds now, which
is the reading a pass that writes its properties every frame needs and the
one that tells a mistyped property name from an effect that is not
grading. The schema and the values are the engine's own record of the
effect — the schema it was registered with and every write the chain
accepted into its uniform, the same record /runtime/fx/<name>/meta.json
is serialized from. A write the chain refused is not in it, and neither is
one made against a property the schema does not declare.
Before an effect is registered its schema lives on the .shader asset it
will render: asset.resolve("@builtin::shaders.post.bloom", "shader"):getProperties() names what that shader declares.
Parameters
namestring— Effect name.
Returns PostprocessDescription? — The effect's state, schema and live values, or nil when nothing is registered under the name. An effect the renderer registers itself declares no properties of its own, and its properties and values are empty.
local e = postprocess.describe("vignette")
print(if e then e.values.intensity else "not registered")
for _, p in ipairs(postprocess.describe("bloom").properties) do
print(p.name, p.type, p.min, p.max)
end
globals/postprocess/displayCurves
postprocess.displayCurves() -> { string }
The display curves __display__ draws with, by name, in the order of
their numbers: clamp (each channel clipped at the peak), reinhard,
aces (the ACES 1.x RRT + sRGB ODT tone scale, Hill's fit), pbrNeutral
(Khronos PBR Neutral), agx (the default), agxPunchy, tony (Tony
McMapface) and gt (Gran Turismo). Every curve but the clamp and Tony
McMapface keeps a brightening colour's hue, and every curve but the clamp
carries light too bright for its colour on toward white with every step
still showing; Tony McMapface turns a bright colour's hue the way the eye
sees it turn. Pass a name to
setProperty("__display__", "curve", name); the curves are
@builtin::shaderModules.displayCurves.
Returns { string } — The curve names, a fresh array.
postprocess.setProperty("__display__", "curve", postprocess.displayCurves()[5])
globals/postprocess/list
postprocess.list() -> { string }
List all registered post-process effect names in renderer priority order (lower priority runs first).
Returns { string } — Array of effect names.
for _, n in ipairs(postprocess.list()) do print(n) end
globals/postprocess/remove
postprocess.remove(name: string) -> boolean
Queue removal of a post-process effect. Takes effect on the next frame. Removing a name that isn't registered is a silent no-op.
Parameters
namestring— Effect name to remove.
Returns boolean — True when the mutation was queued. False, named in a WARN, for the effects the renderer registers itself: __display__, the chain's display transform, which stays in every frame and is tuned through its curve and exposure properties, __output__, the output stage that writes the presented surface (renderer.output), and __blit__, the copy that carries every render into its target, every capture and the viewport included.
postprocess.remove("vignette")
globals/postprocess/setEnabled
postprocess.setEnabled(name: string, enabled: boolean) -> boolean
Queue an enable/disable toggle on a registered post-process effect. Targeting an unknown name is a silent no-op.
Parameters
namestring— Effect name.enabledboolean— True to enable, false to disable.
Returns boolean — True when the mutation was queued. False, named in a WARN, for a __display__ disable (the chain's display transform stays in every frame, and curve = "clamp" is its linear curve), for an __output__ disable (renderer.output.set({ dither = "off" }) writes the frame undithered) and for a __blit__ enable (the copy that carries every render into its target joins no chain).
postprocess.setEnabled("bloom", false)
globals/postprocess/setProperty
postprocess.setProperty(name: string, prop: string, value: (number | { number } | string)) -> boolean
Set a named material property on a registered post-process
effect. The property must be declared in the effect's properties
schema; read in WGSL as material.<prop>. value is a number or a
number array (vec/color), inside the range the schema declares. A
property with options (describe lists them) takes one of their names:
__display__'s curve takes a display curve's name
(postprocess.displayCurves()), and its number is the deprecated form.
Parameters
namestring— Effect name.propstring— Declared property name.value(number | { number } | string)— Number, array of numbers, or the name of one of the property's options.
Returns boolean — True when the effect's uniform took the value; false when it did not — an effect that is not registered, one that declares no property by that name, a value outside the declared range, and a name none of the property's options carry are each named in a WARN in the engine log. A call made from inside queue() or batch(), where the engine has not run the write by the time the call returns, answers true for the queued request.
postprocess.setProperty("vignette", "intensity", 0.6)
postprocess.setProperty("__display__", "curve", "agx")
globals/postprocess/setSampler
postprocess.setSampler(name: string, opts: { [string]: any }) -> boolean
Configure the per-effect user sampler shared by the effect's declared texture properties. opts.filter = "linear" (default) or "nearest". opts.wrap (alias .address) = "clamp" (default), "repeat", or "mirror" — applied to all axes.
Parameters
namestring— Effect name.opts{ [string]: any }—{ filter = "linear"|"nearest", wrap = "clamp"|"repeat"|"mirror" }.
Returns boolean — True — the mutation was queued.
postprocess.setSampler("blur", { filter = "linear", wrap = "clamp" })
globals/postprocess/setTexture
postprocess.setTexture(name: string, prop: string, path: string) -> boolean
Bind a texture to one of an effect's declared texture properties.
Declare it in properties ({ name = "noise", type = "texture" }) and
sample in WGSL as textureSample(noise, noise_sampler, in.uv). path
is a texture asset (a guid, an identity such as
@builtin::textures.foo, a name, a .texture path), a color:1,0,0 /
default:white spec, a render-target or compute-target name, or an
array:a|b of texture layers. A texture asset the slot takes is put on
the GPU and bound by its guid, which is the name postprocess.status()
reports the binding under. A path whose texture has not reached the GPU yet is held
and bound as soon as it does; postprocess.status() reports it under
pendingTextures until then.
Parameters
namestring— Effect name.propstring— Declared texture-property name.pathstring— Texture asset, spec, or render-target name.
Returns boolean — True when the slot took the binding, including one held until its texture reaches the GPU; false when it did not — an effect that is not registered, or one that declares no texture property by that name, is named in a WARN in the engine log. A call made from inside queue() or batch(), where the engine has not run the binding by the time the call returns, answers true for the queued request.
postprocess.setTexture("__vsky_composite", "cloud", "cloud_target")
globals/postprocess/status
postprocess.status() -> { PostprocessStatus }
Every registered effect in chain order with the state that decides
whether it reaches the frame — enabled flag, priority, layer, the
shader's compile error when it has one, the .shader asset it renders
when it was registered from one, the texture each declared slot is bound
to (textures) and the bindings still waiting for their texture
(pendingTextures) — and drawn, whether it drew into the last frame
the renderer drew. drawn is the renderer's own record of the draws it
made, whoever drew the effect: the chain, a render feature's pass using
it as its shader (such an effect is registered enabled = false and
still draws), or the renderer's own stages. So a survey of the chain
answers "is this one affecting the picture right now?" without capturing
a frame and reading pixels, and a script waits for an effect to reach
the picture by waiting for drawn.
An effect this script has just registered is listed with pending = true until the renderer publishes it, since a registration is queued
for the next frame. A published effect reads drawn = false until a
frame includes it: while its pipeline is still building, and for as long
as no camera that draws runs post-processing (the editor camera draws
without it).
Returns { PostprocessStatus } — Array of per-effect state, in the order the chain runs them.
for _, e in ipairs(postprocess.status()) do
print(e.name, e.enabled, e.layer, e.error)
end
typed/builtin//modules/api/engine/postprocess/postprocess/add
postprocess.add(name: string, shader: string | AssetRef, opts: PostprocessOpts?) -> (boolean, string?)
Register a fullscreen post-process effect. This call is what
puts a pass into the frame — a post-process .shader asset defines an
effect, and renders only once registered here. The chain applies the
registration on the caller's own stack and the returned boolean is its
answer, so a setProperty or setTexture naming the effect in the same
call finds it. shader is a .shader asset reference whose shader.wgsl
provides fn fragment(in: PostInput) -> vec4<f32> and whose
properties.yaml declares the effect's properties; the engine generates the
group(0) framework + schema-driven group(1) from that schema. Editing that
shader afterwards recompiles this effect in place, keeping its enabled
state, priority, layer and tuned property values. Registering again under
a name the chain already holds puts this registration in that effect's
place and keeps each value setProperty wrote into it for a property this
registration declares and takes that value for, and each texture
setTexture bound to a slot it declares; postprocess.remove before the
registration starts the effect from its defaults. WGSL text is accepted
in place of a shader reference, and then opts.properties is the whole
schema — this form is deprecated and will be removed, author the effect
as a .shader asset instead. The chain effects of one stage run in
priority order (lower first, default 100); priority = "last" runs the
effect after every numbered chain effect of its stage, and chain effects
sharing a priority (two "last" among them) run in the order they
registered; a priority of 0 or below runs first. A render feature's
passes of the stage run where renderer.post.stages() lists them: in
ui, an afterPost pass runs after every chain effect.
A priority of 4294967295 or above, and any other string, is refused with
the range.
A registered effect runs over the live viewport's frame AND over every
offscreen one — a capture from a world-space station, one orbiting an
entity, one of a named camera, a render-to-texture camera. A texture
camera's picture reaches the screen through the frame that shows it, so an
all-layer effect runs there, over the texture along with the rest of the
interface, and once: the camera's own render runs the scene and display
layers, and the all layer too only with textureColorSpace = "presented"
(a capture's camera, which reads its texture back as the finished frame;
see the Camera component). In each of those
the effect's engine.view_proj / engine.prev_view_proj /
engine.inv_view_proj are the camera THAT render was drawn from and
engine.resolution is that target's own size, so a pass reconstructing
world space from zero_scene_depth(uv) reconstructs against the station
and lens the capture asked for. An offscreen capture is therefore an oracle
for an authored grade: it photographs a chosen station without taking the
on-screen camera from whoever else is driving the scene, and a capture's
postProcessing = false is the one control that takes the chain off the
frame it returns. An offscreen render keeps no view history of its own, so
engine.prev_view_proj there holds that same matrix rather than the frame
before it, and a pass taking camera motion from the two reads none.
Parameters
namestring— Unique effect name.shaderstring | AssetRef— A resolvedshaderasset reference, or author WGSL (fn fragment(in: PostInput)only).optsPostprocessOpts(optional) —{ priority = 100 | "last", enabled = true, stage = "optics"|"display"|"ui", layer = "scene"|"display"|"all" (omitted: follows stage, else space), space = "light"|"display", properties = {{name, type, default?, min?, max?, textureDefault?}}, passes = {{name, entry, scale?, inputs?}} }— with a shader asset,propertieslayers over the asset's own schema.stagenames the post stage of the frame the effect runs in (renderer.post.stages()lists them):"optics"runs it before the display transform, over the scene's light;"display"after the display transform and before the UI, over code values;"ui"after the UI. With a shader asset it defaults to thestage:the asset declares. A stage the frame does not have, or one only render features run in, is refused with the stages there are.layerpicks which composited image the effect grades:"scene"runs it before the UI is drawn, over the scene's own light in a float target, so it grades the rendered picture and leaves every widget on screen as authored;"display"runs it before the UI is drawn too, over the picture the display transform fitted to the screen, and leaves every widget as authored; and"all"runs it after the UI has landed, over that picture, so the interface is graded along with the picture. A call that names neither takes the layer itsspacebelongs to: a"light"effect grades"scene"and a"display"effect grades"display", so a bloom reads the scene's highlights where they still stand above 1.0 and a lookup table reads code values. Naming"all"is what an effect that must grade the interface says — and on a world several authors share, it grades everyone else's screens too.spacenames whatfragment()reads and returns:"light"(the default) for a threshold/blur/grade on the scene,"display"for a lookup table, dither ladder or authored overlay working on code values. With a shader asset, defaults to what that asset'sgetSpace()declares.passesnames the passes the effect draws, each an entry in the shader, a fraction of the view it draws at, and what it reads. With a shader asset, defaults to what that asset'sgetPasses()declares; a single-pass effect (the common case) declares none.textureDefaultis what atype = "texture"property samples while nothing is bound to it:"white"(1,1,1,1 — the default),"black"(0,0,0,1),"normal"(0.5,0.5,1,1) or"transparent"(0,0,0,0). An effect that lays its texture over the scene wants"transparent", so the frame is untouched untilsetTexturebinds a texture that exists.
Returns (boolean, string?) — True when the chain took the effect; false and the compiler's message when it refused it. A shader that does not compile draws nothing at any property value, so it is not registered and postprocess.list() never names it. __display__, __output__ and __blit__ are the renderer's own effects, and a registration under any of them is refused with a message saying so. A call made from inside queue() or batch(), where the engine has not run the registration by the time the call returns, answers true for the queued request.
postprocess.add("vignette", asset.resolve("@builtin::shaders.post.vignette", "shader"))
postprocess.add("vignette", VIGNETTE_WGSL, { properties = {{ name = "intensity", type = "float", default = 0.5 }} })
typed/builtin//modules/api/engine/postprocess/postprocess/describe
postprocess.describe(name: string) -> PostprocessDescription?
One effect by name, read in full: the chain state
postprocess.status() lists for it, and on top of that properties — the
schema the effect declared, each entry { name, type, default?, min?, max?, textureDefault?, options? } in the shape add takes — and values, what
each of those properties currently holds. A property's value is the one
the last setProperty wrote, or the schema's own default where nothing
has written one, and it comes back as a number for a scalar, as the array
for a wider value, and as the option's name for a property with
options (__display__'s curve reads "agx"), which is what
setProperty takes, so a property read here is written straight back.
This is the read-back for a property write. setProperty answers whether
the uniform took the value; this answers what the effect holds now, which
is the reading a pass that writes its properties every frame needs and the
one that tells a mistyped property name from an effect that is not
grading. The schema and the values are the engine's own record of the
effect — the schema it was registered with and every write the chain
accepted into its uniform, the same record /runtime/fx/<name>/meta.json
is serialized from. A write the chain refused is not in it, and neither is
one made against a property the schema does not declare.
Before an effect is registered its schema lives on the .shader asset it
will render: asset.resolve("@builtin::shaders.post.bloom", "shader"):getProperties() names what that shader declares.
Parameters
namestring— Effect name.
Returns PostprocessDescription? — The effect's state, schema and live values, or nil when nothing is registered under the name. An effect the renderer registers itself declares no properties of its own, and its properties and values are empty.
local e = postprocess.describe("vignette")
print(if e then e.values.intensity else "not registered")
for _, p in ipairs(postprocess.describe("bloom").properties) do
print(p.name, p.type, p.min, p.max)
end
typed/builtin//modules/api/engine/postprocess/postprocess/displayCurves
postprocess.displayCurves() -> { string }
The display curves __display__ draws with, by name, in the order of
their numbers: clamp (each channel clipped at the peak), reinhard,
aces (the ACES 1.x RRT + sRGB ODT tone scale, Hill's fit), pbrNeutral
(Khronos PBR Neutral), agx (the default), agxPunchy, tony (Tony
McMapface) and gt (Gran Turismo). Every curve but the clamp and Tony
McMapface keeps a brightening colour's hue, and every curve but the clamp
carries light too bright for its colour on toward white with every step
still showing; Tony McMapface turns a bright colour's hue the way the eye
sees it turn. Pass a name to
setProperty("__display__", "curve", name); the curves are
@builtin::shaderModules.displayCurves.
Returns { string } — The curve names, a fresh array.
postprocess.setProperty("__display__", "curve", postprocess.displayCurves()[5])
typed/builtin//modules/api/engine/postprocess/postprocess/list
postprocess.list() -> { string }
List all registered post-process effect names in renderer priority order (lower priority runs first).
Returns { string } — Array of effect names.
for _, n in ipairs(postprocess.list()) do print(n) end
typed/builtin//modules/api/engine/postprocess/postprocess/remove
postprocess.remove(name: string) -> boolean
Queue removal of a post-process effect. Takes effect on the next frame. Removing a name that isn't registered is a silent no-op.
Parameters
namestring— Effect name to remove.
Returns boolean — True when the mutation was queued. False, named in a WARN, for the effects the renderer registers itself: __display__, the chain's display transform, which stays in every frame and is tuned through its curve and exposure properties, __output__, the output stage that writes the presented surface (renderer.output), and __blit__, the copy that carries every render into its target, every capture and the viewport included.
postprocess.remove("vignette")
typed/builtin//modules/api/engine/postprocess/postprocess/setEnabled
postprocess.setEnabled(name: string, enabled: boolean) -> boolean
Queue an enable/disable toggle on a registered post-process effect. Targeting an unknown name is a silent no-op.
Parameters
namestring— Effect name.enabledboolean— True to enable, false to disable.
Returns boolean — True when the mutation was queued. False, named in a WARN, for a __display__ disable (the chain's display transform stays in every frame, and curve = "clamp" is its linear curve), for an __output__ disable (renderer.output.set({ dither = "off" }) writes the frame undithered) and for a __blit__ enable (the copy that carries every render into its target joins no chain).
postprocess.setEnabled("bloom", false)
typed/builtin//modules/api/engine/postprocess/postprocess/setProperty
postprocess.setProperty(name: string, prop: string, value: (number | { number } | string)) -> boolean
Set a named material property on a registered post-process
effect. The property must be declared in the effect's properties
schema; read in WGSL as material.<prop>. value is a number or a
number array (vec/color), inside the range the schema declares. A
property with options (describe lists them) takes one of their names:
__display__'s curve takes a display curve's name
(postprocess.displayCurves()), and its number is the deprecated form.
Parameters
namestring— Effect name.propstring— Declared property name.value(number | { number } | string)— Number, array of numbers, or the name of one of the property's options.
Returns boolean — True when the effect's uniform took the value; false when it did not — an effect that is not registered, one that declares no property by that name, a value outside the declared range, and a name none of the property's options carry are each named in a WARN in the engine log. A call made from inside queue() or batch(), where the engine has not run the write by the time the call returns, answers true for the queued request.
postprocess.setProperty("vignette", "intensity", 0.6)
postprocess.setProperty("__display__", "curve", "agx")
typed/builtin//modules/api/engine/postprocess/postprocess/setSampler
postprocess.setSampler(name: string, opts: { [string]: any }) -> boolean
Configure the per-effect user sampler shared by the effect's declared texture properties. opts.filter = "linear" (default) or "nearest". opts.wrap (alias .address) = "clamp" (default), "repeat", or "mirror" — applied to all axes.
Parameters
namestring— Effect name.opts{ [string]: any }—{ filter = "linear"|"nearest", wrap = "clamp"|"repeat"|"mirror" }.
Returns boolean — True — the mutation was queued.
postprocess.setSampler("blur", { filter = "linear", wrap = "clamp" })
typed/builtin//modules/api/engine/postprocess/postprocess/setTexture
postprocess.setTexture(name: string, prop: string, path: string) -> boolean
Bind a texture to one of an effect's declared texture properties.
Declare it in properties ({ name = "noise", type = "texture" }) and
sample in WGSL as textureSample(noise, noise_sampler, in.uv). path
is a texture asset (a guid, an identity such as
@builtin::textures.foo, a name, a .texture path), a color:1,0,0 /
default:white spec, a render-target or compute-target name, or an
array:a|b of texture layers. A texture asset the slot takes is put on
the GPU and bound by its guid, which is the name postprocess.status()
reports the binding under. A path whose texture has not reached the GPU yet is held
and bound as soon as it does; postprocess.status() reports it under
pendingTextures until then.
Parameters
namestring— Effect name.propstring— Declared texture-property name.pathstring— Texture asset, spec, or render-target name.
Returns boolean — True when the slot took the binding, including one held until its texture reaches the GPU; false when it did not — an effect that is not registered, or one that declares no texture property by that name, is named in a WARN in the engine log. A call made from inside queue() or batch(), where the engine has not run the binding by the time the call returns, answers true for the queued request.
postprocess.setTexture("__vsky_composite", "cloud", "cloud_target")
typed/builtin//modules/api/engine/postprocess/postprocess/status
postprocess.status() -> { PostprocessStatus }
Every registered effect in chain order with the state that decides
whether it reaches the frame — enabled flag, priority, layer, the
shader's compile error when it has one, the .shader asset it renders
when it was registered from one, the texture each declared slot is bound
to (textures) and the bindings still waiting for their texture
(pendingTextures) — and drawn, whether it drew into the last frame
the renderer drew. drawn is the renderer's own record of the draws it
made, whoever drew the effect: the chain, a render feature's pass using
it as its shader (such an effect is registered enabled = false and
still draws), or the renderer's own stages. So a survey of the chain
answers "is this one affecting the picture right now?" without capturing
a frame and reading pixels, and a script waits for an effect to reach
the picture by waiting for drawn.
An effect this script has just registered is listed with pending = true until the renderer publishes it, since a registration is queued
for the next frame. A published effect reads drawn = false until a
frame includes it: while its pipeline is still building, and for as long
as no camera that draws runs post-processing (the editor camera draws
without it).
Returns { PostprocessStatus } — Array of per-effect state, in the order the chain runs them.
for _, e in ipairs(postprocess.status()) do
print(e.name, e.enabled, e.layer, e.error)
end