std/visuals
Import: use "std/visuals";
GPU visual operators — generators, filters, and the raw-shader Visual. Wire nodes with >> (primary input; route to screen to display) and bind parameters or texture inputs with node.param("name") << signal. screen is the global output sink, like master.
A blur visual (Blur()). Bind its parameters with b.param("name") << ….
Constructor
Section titled “Constructor”fn Blur() -> BlurA blur visual: a TouchDesigner-style Blur TOP that softens its primary input (set via src >> Blur()) with a 5×5 box kernel whose spacing scales with radius, so it blurs at large radii too.
Parameters:
radius— blur radius in pixels
Returns: Blur — a filter node, routable with >> and bindable with .param
fn param(name: String) -> VisualParamBinds a uniform by name, e.g. b.param("radius") << sig.
Composite
Section titled “Composite”A composite visual (Composite()). Bind its parameters with c.param("name") << ….
Constructor
Section titled “Constructor”fn Composite() -> CompositeA composite visual: a TouchDesigner-style Composite TOP that blends its primary input A (set via src >> Composite()) with a second input B (set via c.param("b") << node, where node may be a forward node or prev inside feedback(...)). Bind operand to pick the blend (rounded to nearest): 0 over, 1 add, 2 subtract, 3 multiply, 4 difference, 5 subtractive, 6 max/lighten, 7 min/darken, 8 screen. Results are clamped to [0,1].
Parameters:
operand— blend-mode selector (see list above)b— second input B (texture input; wire a node with<<)
Returns: Composite — a filter node, routable with >> and bindable with .param
fn param(name: String) -> VisualParamBinds a uniform or input slot by name, e.g. c.param("operand") << 1.0 or c.param("b") << node.
Displace
Section titled “Displace”A displace visual (Displace()). Bind its parameters/slots with d.param("name") << ….
Constructor
Section titled “Constructor”fn Displace() -> DisplaceA displace visual: offsets each pixel lookup of its primary input (set via src >> Displace()) by a displacement field fed into the by slot (d.param("by") << field or d.param("by") << prev inside feedback(...)).
Parameters:
amount— displacement strengthby— displacement field (texture input; wire a node with<<)
Returns: Displace — a filter node, routable with >> and bindable with .param
fn param(name: String) -> VisualParamBinds a uniform or the by input slot by name, e.g. d.param("amount") << sig or d.param("by") << field.
An edge visual (Edge()). Bind its parameters with e.param("name") << ….
Constructor
Section titled “Constructor”fn Edge() -> EdgeAn edge visual: a spatial filter that Sobel-detects the boundaries of its primary input (set via src >> Edge()), turning a soft noise/voronoi field into bright cell-contour lines.
Parameters:
strength— edge gain
Returns: Edge — a filter node, routable with >> and bindable with .param
fn param(name: String) -> VisualParamBinds a uniform by name, e.g. e.param("strength") << sig.
Lookup
Section titled “Lookup”A lookup visual (Lookup()). Wire its gradient input with l.param("gradient") << ramp.
Constructor
Section titled “Constructor”fn Lookup() -> LookupA lookup visual: a TouchDesigner-style Lookup TOP that colourises its primary input (set via src >> Lookup(), used as the index) by sampling a gradient fed into the gradient slot (l.param("gradient") << ramp) at the index’s luminance.
Parameters:
gradient— colour gradient input (texture input; wire a Ramp with<<)
Returns: Lookup — a filter node, routable with >> and bindable with .param
fn param(name: String) -> VisualParamBinds the gradient input slot by name: l.param("gradient") << ramp.
LumaLevel
Section titled “LumaLevel”A luma-level visual (LumaLevel()). Bind its parameters with l.param("name") << ….
Constructor
Section titled “Constructor”fn LumaLevel() -> LumaLevelA luma-level visual: a TouchDesigner-style Luma Level TOP over its primary input (set via src >> LumaLevel()). Brightness / black-level / gamma / invert controls, e.g. to lift a crushed image into a colour Lookup’s range.
Parameters:
brightness— output gainblack— black-level offsetgamma— gamma exponentinvert— 0..1 invert mix
Returns: LumaLevel — a filter node, routable with >> and bindable with .param
fn param(name: String) -> VisualParamBinds a uniform by name, e.g. l.param("brightness") << sig.
A noise generator visual (Noise()): an animated TouchDesigner-style fractal value-noise field. Bind its parameters with n.param("name") << ….
Constructor
Section titled “Constructor”fn Noise() -> NoiseA noise generator visual: an animated TouchDesigner-style fractal value-noise field, the green-TOP-style source of an operator chain. Bind its TD noise TOP parameters with .param("name") << ….
Parameters:
period— feature size; larger is bigger cellsharmonics— fbm octave countgain— per-octave amplitude falloffexponent— contrast shaping, powoffset— brightness floor
Returns: Noise — a generator node, routable with >> and bindable with .param
fn param(name: String) -> VisualParamBinds a uniform by name, e.g. n.param("period") << sig.
A ramp generator visual (Ramp()). Bind its parameters with r.param("name") << ….
Constructor
Section titled “Constructor”fn Ramp() -> RampA ramp generator visual: a TouchDesigner-style Ramp TOP drawing a 4-key colour gradient (no input). The keys color0..color3 sit at 0, pos1, pos2, 1; type picks orientation (0 horizontal, 1 vertical, 2 radial). The defaults make a black→blue→light-blue→white palette for Lookup.
Parameters:
type— orientation selector (0 horizontal, 1 vertical, 2 radial)color0— gradient key at position 0, a vec3color1— gradient key atpos1, a vec3color2— gradient key atpos2, a vec3color3— gradient key at position 1, a vec3pos1— second key positionpos2— third key position
Returns: Ramp — a generator node, routable with >> and bindable with .param
fn param(name: String) -> VisualParamBinds a uniform by name, e.g. r.param("type") << 2.0.
RgbKey
Section titled “RgbKey”An RGB-key visual (RgbKey()). Bind its parameters with k.param("name") << ….
Constructor
Section titled “Constructor”fn RgbKey() -> RgbKeyAn RGB-key visual: a TouchDesigner-style RGB Key TOP that blacks out pixels of its primary input (set via src >> RgbKey()) within threshold of the key colour, passing the rest through. With the defaults (black key, threshold 0) it is a pass-through.
Parameters:
key— colour to key out, a vec3threshold— key range/softness
Returns: RgbKey — a filter node, routable with >> and bindable with .param
fn param(name: String) -> VisualParamBinds a uniform by name, e.g. k.param("threshold") << sig.
Screen
Section titled “Screen”The display output sink. screen is a global (like master): route a visual with v >> screen, then adjust presentation via its methods.
quality
Section titled “quality”fn quality(n: Number) -> ScreenSets the supersampling (SSAA) quality — the internal render resolution as a multiple of the presented window. Higher is smoother but costs ~n² GPU work; clamped to the renderer’s supported range. Takes effect live.
Parameters:
n(Number) — render-scale multiple (≥ 1)
Returns: Screen — the sink, for chaining
show_window
Section titled “show_window”fn show_window() -> ScreenOpens the native live-rendering window for the routed visual, rendered on the GPU in-process from the routed graph and transport (audio meter feeds read as zero for now). A no-op if the window is already open.
Returns: Screen — the sink, for chaining
fn snap(path: String) -> ScreenRenders the routed visual off-screen on the GPU and writes it to a PNG at the given path (resolved relative to the working directory). Works headless, so it also runs in an offline resonon file.non render. Rendered at the export resolution (independent of the live window) with quality’s SSAA.
Parameters:
path(String) — output PNG path
Returns: Screen — the sink, for chaining
A slope visual (Slope()). Bind its parameters with s.param("name") << ….
Constructor
Section titled “Constructor”fn Slope() -> SlopeA slope visual: a TouchDesigner-style Slope TOP that turns the luminance gradient of its primary input (set via src >> Slope()) into a signed RG displacement field, re-centred around offset for a downstream Displace.
Parameters:
strength— gradient gainoffset— re-centre point
Returns: Slope — a filter node, routable with >> and bindable with .param
fn param(name: String) -> VisualParamBinds a uniform by name, e.g. s.param("strength") << sig.
Transform
Section titled “Transform”A transform visual (Transform()). Bind its parameters with t.param("name") << ….
Constructor
Section titled “Constructor”fn Transform() -> TransformA transform visual: a TouchDesigner-style Transform TOP that translates, rotates and scales its primary input (set via src >> Transform()) about a pivot. Positive scale zooms in, positive rotate spins counter-clockwise; rotation is aspect-corrected so a wide canvas spins without shearing. extend picks how pixels outside the source are filled (rounded to nearest): 0 hold/clamp, 1 repeat, 2 mirror, 3 black. With the defaults it is a pass-through.
Parameters:
translate— uv-fraction offset (+x right, +y up), a vec2rotate— rotation in degrees (positive is counter-clockwise)scale— per-axis zoom, a vec2pivot— centre of rotate/scale, a vec2extend— outside-source fill mode (see list above)
Returns: Transform — a filter node, routable with >> and bindable with .param
fn param(name: String) -> VisualParamBinds a uniform by name, e.g. t.param("rotate") << sig.
Visual
Section titled “Visual”A GPU fragment-shader visual. Bind uniforms with v.param("name") << signal and route to the display with v >> screen.
Built-in uniforms are always supplied without binding (declare and use them):
iTime— transport time in seconds (beat-synced; freezes when stopped)iResolution— canvas size in pixels (vec2)iBeat— continuous beat positioniCycle— continuous cycle position
These names are reserved and cannot be bound.
Custom shaders compiled with Visual(source) expose their own uniforms; any name is accepted. Live audio meter feeds are bindable: v.param("kick") << drums.rms, v.param("level") << master.peak (each track and the master expose .rms / .peak).
Constructor
Section titled “Constructor”fn Visual(source: String) -> VisualCompiles a fragment-shader source string into a Visual. Share GLSL between shaders by composing source strings in Resonon, e.g. Visual(load_file("shaders/lib.glsl") + frag).
Example:
v = Visual(frag);
Parameters:
source(String) — GLSL-ES fragment shader source (non-empty)
Returns: Visual — a compiled visual, bindable with << and routable with >>
fn param(name: String) -> VisualParamBinds a uniform by name: v.param("name") << signal.
Parameters:
name(String) — the GLSL uniform name
Returns: VisualParam — a parameter reference, bound with <<
VisualParam
Section titled “VisualParam”A reference to a visual operator’s parameter, produced by node.param("name") and consumed by << (v.param("period") << sig). Not used on its own.
feedback
Section titled “feedback”fn feedback(build: Function) -> VisualBuilds a feedback group: the closure is called with prev — the group’s previous-frame output as a sampleable visual — and returns the group output. Wire prev into a slot (e.g. d.param("by") << prev) to close the loop; the renderer realizes it as a ping-pong buffer. Route the result with >> screen.
Example:
feedback(fn(prev) { let d = Displace(); d.param("by") << prev; return Noise() >> d; })
Parameters:
build(Function) —fn(prev) { ... }, returning the group’s output Visual
Returns: Visual — the group output, routable with >> and reusable for fan-out
load_shader
Section titled “load_shader”fn load_shader(path: String) -> VisualLoads a fragment shader from an external .glsl file and compiles it. The path is resolved relative to the .non file being run, so existing shader tooling (highlighting, linting) can edit the .glsl directly. Re-executing the routing line after editing the file hot-swaps the shader.
Example:
v = load_shader("shaders/plasma.glsl");
Parameters:
path(String) — shader file path, relative to the current .non file
Returns: Visual — a compiled visual, bindable with << and routable with >>