FX-Map and pixel processor tips
FX-Maps and pixel processors are the parts of Designer that are hardest to build by clicking. MCP Pro for Designer describes both as small JSON specs that the AI writes and reads back. The sand recipe uses a pixel processor for its ripples and the scales recipe is built with an FX-Map, so both are working references.
Which one to use
- Pixel processor: a function evaluated for every pixel. Good for math patterns (ripples, gradients, remaps), sampling inputs at offsets, and combining several images with custom logic.
- FX-Map: draws patterns (discs, squares, images...) many times with per-instance position, size, rotation and color. Good for scattering, grids of shapes and image-based placement.
Function specs
Pixel processors, value processors and parameter functions all use the same format: named nodes, each with an op, optional value and inputs, plus one output. This one inverts the luminance of the first input:
{"nodes": {"p": {"op": "get_float2", "value": "$pos"},
"s": {"op": "samplelum", "inputs": {"pos": "p"}, "value": [0, 0]},
"one": {"op": "const", "value": 1.0},
"inv": {"op": "sub", "inputs": ["one", "s"]}},
"output": "inv"}
Available ops include add, sub, mul, div, lerp, min, max, pow, sin, cos, floor, abs, dot, swizzle1..4, vector2..4, samplelum, samplecol, get_float2 ("$pos"), ifelse and rand. const infers its type from the value; get with a type reads a variable or a graph input by name. list_function_nodes lists the full catalog with ports.
The sand ripples, as a spec
The sand recipe computes 0.5 + 0.5 sin(2π (ripples · y + waviness · noise)), with a Perlin noise as the input image:
{"nodes": {
"p": {"op": "get_float2", "value": "$pos"},
"y": {"op": "swizzle1", "inputs": ["p"], "value": 1},
"n": {"op": "samplelum", "inputs": {"pos": "p"}, "value": [0, 0]},
"count": {"op": "const", "value": 10.0},
"wav": {"op": "const", "value": 1.5},
"a": {"op": "mul", "inputs": ["y", "count"]},
"b": {"op": "mul", "inputs": ["n", "wav"]},
"c": {"op": "add", "inputs": ["a", "b"]},
"tau": {"op": "const", "value": 6.2831853},
"t": {"op": "mul", "inputs": ["c", "tau"]},
"s": {"op": "sin", "inputs": ["t"]},
"half": {"op": "const", "value": 0.5},
"s2": {"op": "mul", "inputs": ["s", "half"]},
"r": {"op": "add", "inputs": ["s2", "half"]}},
"output": "r"}
An integer ripple count keeps the result tileable vertically, and the Perlin input tiles too.
Tools
create_pixel_processor(spec, inputs=[...], grayscale=...)creates the node, wires the input images and sets the function.set_node_function(node, spec, property=...)replaces a function. Withoutpropertyit sets the per-pixel function; with a parameter id it turns that parameter into a dynamic function, for example a Blend'sopacitymultdriven by a graph input.get_node_functionreads a function back in the same format, so the AI can edit existing work instead of rewriting it.
FX-Map specs
An FX-Map spec is a tree: a root and nodes with an op (quadrant, switch, iterate, dot), params, children and parameter functions. Sixty randomly placed discs:
{"root": "it", "nodes": {
"it": {"op": "iterate", "params": {"numberadded": 60},
"children": {"output1": "q"}},
"q": {"op": "quadrant",
"params": {"patterntype": "disc", "patternsize": [0.06, 0.06]},
"functions": {"frameoffset": {"nodes": {
"one": {"op": "const", "value": 1.0},
"x": {"op": "rand", "inputs": ["one"]},
"y": {"op": "rand", "inputs": ["one"]},
"v": {"op": "vector2", "inputs": ["x", "y"]}}, "output": "v"}}}}}
iterate:output0runs once,output1runsnumberaddedtimes.quadrantparameters:patterntype(disc, square, paraboloid, bell, gaussian, thorn, pyramid, brick, gradation, waves, crescent, capsule, cone, hemisphere, orimage_entryfor a pattern input),patternsize,patternrotation(turns),frameoffset,opacity,blendingmode,imageindex,randomseed.- Functions use the same format as pixel processors, with
$number(iteration index),$depthandrandfor per-instance variation.
Tools: create_fxmap builds the node and its inner graph (pattern images via inputs), get_fxmap_graph reads it back, set_fxmap_graph replaces it, and set_fxmap_node edits one inner node's parameters or functions.
Tips for reliable results
- Read before editing. Ask the AI to call
get_node_functionorget_fxmap_graphfirst, then change one thing. - Preview after every change.
get_node_previewon the processor or FX-Map node catches sign errors and wrong scales at once. - Keep instance counts reasonable. Large
numberaddedvalues multiply compute time. Run heavy computes withstart_job. - Mind grayscale versus color. Both nodes take a
grayscaleflag. A grayscale image on a color Blend's foreground is silently ignored by Designer;validate_graph(fix=true)inserts the conversion. - Use graph inputs in functions.
getwith a type reads a graph input, so a ripple count or density can be exposed and tweaked later in the .sbsar. - Learn from the recipes. Build
sandorscales, then ask the AI to read their functions back and explain them.
Get MCP Pro for Designer
Early Access, $12 once, free updates.