A Blur stops at radius 8 in one pass, and bloom needs a softened copy
of the picture beside the original. A Pass node cuts the graph: what
feeds it is drawn into a picture of its own first, and the nodes that
read a picture read that one when it feeds them.
- Pass has color and alpha like the Output, a Resolution setting
(Full, Half, Quarter) and a picture output. Texture color, Texture
alpha, Sample texture, Blur and Texture size get a picture input.
Unconnected it is the wearer's own picture, so the original stays
readable beside any pass.
- picture is a port type of its own. It plugs only into a picture
input, not even into an any port.
- The walk shared by the compilers can stop at a node (cut). The
shader compiler draws each Pass it meets as a fragment of its own,
earlier passes first. A ring through a picture says Feeds itself,
and more than 8 passes say so at the node.
- A pass draws untinted. The tint comes on when the last part reads a
picture, so a particle source draws its passes once for all of its
particles (user decision).
- A pass's picture is the wearer's picture and its Padding, at the
pixels of the picture times Resolution, at most 2048 per side. It is
read with the picture's own filter and continues past its frame as
the Output's Edge says.
- PassPictures keeps one render texture per pass and wearer. It draws
again only when picture, size, Padding or a uniform changed. A
field's picture is a render texture that changes under the same id,
so a field draws its passes every time.
- Sprite, sliced sprite, text, particle source, field shader and the
Shader tab's preview all draw passes. syncShader takes a fixed
picture for a 9-slice, which holds its corners but keeps the margin.
- texelAt and blur take the sampler they read. Existing shaders
compile to the same program apart from that argument.
- A field shader's Blur and Texture size count a pixel as a unit of
the frame (uPixelScale), not of the screen. Before, a field's blur
grew when zooming out and shrank when zooming in. This came with
#170 and #300 and is fixed here because passes inherit it.
- tools/perf-shaders.mjs and tools/perf-field-shaders.mjs measure two
passes with GM_PERF_PASSES=1 and GM_PERF_PASS_RESOLUTION. Below Full
an open Pass shrinks the picture first, as the wiki's recipe does.
Found on the way:
- Destroying the pictures before the shader made Pixi warn that a
texture was still bound. The shader goes first now, and a picture of
a new size is resized rather than replaced.
- Two passes in a row could draw plain white the first time. Pixi
builds the code that binds a program's resources once and finds them
by position. A pass of one graph is often the same program as a pass
of another with fewer slots, so it bound a placeholder. Every shader
now declares all 8 pass slots and its uniform group.
Tests:
- Gate on melektaus-atx: 225 files, 3480 tests (3467 + 13), exit 0.
- e2e 28 and 31 on melektaus-atx: 97 checks (94 + 3) and 44 checks
(43 + 1), all passed, no Pixi warning in the console.
- 28l-vii: a Blur across, a Pass and a Blur down draw the 5x5 spot of
a Blur of Both (difference 0.000). On a grey sprite a pass's picture
added to the original is 231/60/60, each tinted once. Two Passes in
a row after a graph with one show red and green, not white.
- 31v-iii: a Blur of 8 fades a field's frame edge over 8.0 units at
50 % and at 200 % zoom.
- Counter-checks: a tinted pass fails 1 unit test. Pictures never
bound fail both e2e checks (spot 0.20 instead of 0.04, 243/158/158).
Pass slots by the number of passes draw #ffffff, and a field without
its pixel scale ramps over 16 and 4 units: exactly the two new
checks fail.
- e2e sum 1716 is counted, not yet measured (1712 + 4).
- Measured on stein2 (HD 630, one run per row): 50 field shaders at
radius 8 go from 11.4 to 41.3 fps in two passes, 44.4 at radius 16
(three passes at Half). 800 sprites at radius 8 go from 13.9 to
24.5 fps. At radius 4 one pass stays faster from 400 sprites on.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>