Coldwave

render#

Part of the scripting reference, written by the engine so it matches your frost. Start with your first game if you are new.

Use when configuring bloom, materials, see-through meshes, frame graphs or effects, or diagnosing rendering such as why a pixel is dark.

  • See-through meshes. A mesh is see-through when its model's material is blended or its thing's Mesh.blend says so. How much of it covers what is behind it is its alpha: what its material's fragment returns (see Materials), where color.a is the paint's own (corner colour times picture). Return that to keep it, or another for a pane that clears by its angle. A thing that is not see-through ignores it. Mesh.blend says how (the table under this). Into a 16-bit float target shown through aces, added light adds up above white before the tone curve, in a browser too (WebGPU and WebGL 2, which blends into such a target wherever it can draw into one). A see-through thing is tested against depth and writes none: what is whole and nearer hides it, and two that cross are each seen through the other. Mesh.depth = "write" has it write depth as a whole thing does. One blended over what is behind it is drawn far side first, then near side (by which way its faces wind), so a closed one is not seen inside out. A thing faded by Opacity alone writes depth.
In a scriptDoes
Mesh.blendThe thing is
------
""as its model's material says
"opaque"whole
"blend"over what is behind it by its alpha
"premultiplied"the same, its colour taken as already times its alpha (alpha 0 adds)
"add"added, as a 2D thing's Blend adds: its light times its alpha, and what is behind it stays whole (a beam, a flame). It fades into haze, casts no shadow and leaves no ambient occlusion
TOML
# Optional frame graph. Omitted: all layers into `frame` in 2D; sky if present,
# meshes, then layers in 3D. Named `targets`: `format` "rgba8" (default), "rgba16f"
# or "depth"; `size` "frame" (default), "frame/N" (N 2..16), or a pixel side length.
# Each named pass writes `into` a target (default `frame`) and either draws or runs
# an effect on its `read` targets. Draws: "layers", from `from` to `to` inclusive
# (default all); in 3D, "meshes" (lit, tested against its `depth` target) or "sky"
# (the world's Sky over the target; put before meshes). First writes clear; work
# never reaching `frame` is dropped. `render.passes` lists the running graph.
# Effects: "copy"; "bright", above `threshold` (0.6); "blur"; "add", second target
# added `strength` times (1) to first (float targets keep values above 1); "panini", distance `strength` (0 none),
# bending a wide 3D view to fill, keeping its middle. A `Pass` sets numbers each frame.
# `bright` into rgba16f keeps radiance above a nonnegative threshold, including 1.
# Into rgba8 its threshold must be below 1; it normalizes by (1 - threshold).
# "aces": exposure `strength` (default 1, nonpositive 0), then ACES fitted curve,
# then sRGB. Requesting it enables linear mesh/sky output above 1 into rgba16f,
# including emission, fog and blending. Without it, existing graphs stay unchanged.
# Draw sky/meshes into rgba16f, read that with aces, draw layers afterward (UI/text
# unchanged). WebGL2 needs renderable/filterable/blendable
# half-float support (E0208 otherwise). frame.at names presentation unread.
# `materials` (3D, alone or with passes): `vertex` and/or `fragment` WGSL files for
# Mesh (see Meshes). `bloom = { threshold = 0.85, strength = 1.5 }` (defaults; alone
# or with materials) softens brightness above threshold (0..1), adding it strength
# times. Generated passes `bright`, `soften`, `bloom` accept Pass numbers. All 2D
# blooms; in 3D, sky/meshes bloom, overlay layers do not. Custom passes cannot use
# this shorthand: place bright/blur/add there yourself.
# `ao = { radius = 1, strength = 1 }` (defaults; 3D, alone or with any of the above,
# custom passes included): ambient occlusion. Where surfaces within `radius` metres
# (0..100] close a point in (a corner, a crate on a floor), the ambient light and the
# sky a metal mirrors darken, up to `strength` (0..1). Sun, lamps, shadows, emission
# and layers are untouched. It adds passes `ao_seen`, `ao_occlude` (a Pass sets radius
# and strength) and `ao_soften` before the first meshes pass, with targets `ao`,
# `ao_distance`, `ao_depth`, `ao_rough`. Fixed sample pattern: no shimmer, one picture
# every run. Screen-space: what is hidden or off screen shades nothing; see-through and
# masked parts shade nothing. frame.at names it unread.
# `effects` (up to 8): `name = { file = "x.wgsl", reads = 1 }` (1 or 2). The file's
# `fn effect(at: vec2<f32>, size: vec2<f32>, threshold: f32, strength: f32) -> vec4<f32>`
# returns colour at pixel centre `at` in target `size` (pixels), in the target's encoding.
# Read helpers: one(px), two(px) (whole pixels, same bytes across backends),
# under_one(at), under_two(at), one_size(), one_soft(uv), two_soft(uv) (between pixels),
# lens(). No clock: animate via Pass numbers. Compilation errors name file/line (E0456).
[render]
# HDR resolves rgba16f before aces, then UI.
# msaa = 4        # default 1; sky/meshes first, resolve before effects/UI. A smoothed edge's pixel may be one level off in WebGL2 (its own rounding)
# cull = true     # follow glTF sides. Left out: false
# samplers = true # follow glTF filters. Left out: false
# sky = { size = 512 } # texels a side a pictured sky (Sky.picture) is seen at, 64 to 1024 and no
#                      # more than half its width. Left out: 512. Its light is from 64 a side
#                      # whatever this is. The sky's float atlas on the device: 1.5 MB with no
#                      # picture, 5.8 MB at 512, 19.9 MB at 1024, and twice that again in memory
#                      # for each sky held.

Generated from Coldwave 0.0.1 r335, 2026-11-30 by the binary itself: do not edit by hand.