A scale about the picture's middle moves each corner by its distance
to the middle times (scale - 1). In pixels that distance needs the
picture's size, and Texture size was locked at the Vertex output as a
per-pixel node. So the size had to be typed in by hand and was only
right for pictures of exactly that size.
- At a corner Texture size reads the uniform uPictureSize. It holds
the size the Vertex output counts its pixels in, the same number the
node gives in the fragment. The offset is divided by that size again,
so a scale comes out right for every picture and sprite size.
- A node can say what it is at a corner through emitPerCorner. The
walker takes it there and emit everywhere else.
- Fed a Pass's picture, Texture size stays locked at the Vertex output.
A Pass has no picture at a corner.
- 9-slice, field and camera shaders do not move corners. Their size is
0 there and nothing changes for them.
Tests:
- Unit shader-vertex: the node compiles at a corner to uPictureSize
and the Output still reads textureSize. shader-passes: a Pass's
picture into Texture size at the Vertex output is refused.
- Against the old perPixel flag the new unit test fails.
- e2e 28l-iv: width * 0.5 at x moves the 32 px picture as far as the
constant 16 did, same three colours. With the size forced to 0 on
the GPU the check fails and the picture stands still.
- The case "Texture size is refused at a corner" left the it.each
that lists refused nodes, so the test count stays the same.
- e2e 28 on melektaus-atx: ALL PASSED, 101 checks.
- Gate on melektaus-atx: CHECK EXIT 0, 297 files, 4562 tests.
- tsc, eslint, Prettier clean.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A shader could only ask its sprites for numbers. A tint, an outline
colour or a glow colour had to be built from three Property nodes.
- New node Color property next to Property: Name and Default (a
colour, white unless picked), output `color`. It becomes a colour
row below the Shader dropdown and a vec3 uniform in the program.
- Number and colour properties share one set of names. A clash is
the existing "Another property is named" problem.
- Like Color it cannot feed the Vertex output.
- Placed from the palette it is called tint, then tint2.
- The preview in the Shader tab shows a colour field for it. Like
the sliders it starts at the sprite's value and never writes into
the project.
- `declaredRows` takes the row builder, so the particle graph keeps
its number rows unchanged.
Tests:
- Gate: 222 files, 3452 tests (3445 + 7)
- e2e 28: 89 checks (28l-v: default colour drawn, then the colour
the sprite sets)
- e2e total 1704, counted (1703 + 1)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A shader could only say what colour a pixel has. Where the picture
is drawn was fixed to the four corners of its rectangle, so nothing
could wave, bend or wobble.
- The new node Vertex output takes x and y, in pixels of the
picture, and moves every corner of the wearer's grid by them. The
UVs stay with the corners, so the picture bends along.
- Subdivisions on that node says how fine the grid is: cells per
axis, 1 to 64, 8 by default. 1 is the plain quad. A shader without
the node keeps the quad every sprite shares.
- A graph holds one Vertex output at most. UV, Time, Property,
Number and the math nodes may feed it, and one node may feed both
outputs.
- Texture color, Texture alpha, Sample texture, Texture size and
Color cannot feed it. The node says "Not available per corner"
and the shader does not compile.
- Sprites, texts and the preview in the shader tab wear the grid.
A nine-slice sprite and particles draw as if the node were not
there.
- Picking, the selection frame, the size and colliders stay with
the rectangle. A wearer with a Vertex output is never culled, as
with Padding, and with Padding the grid covers the room around
the picture too.
- tools/perf-shaders.mjs takes GM_PERF_SUBDIVISIONS to measure a
grid against the plain quad.
Measured on stein2 (Intel HD 630), frames per second, one run per
row: at 800 sprites 58 with a shader on the quad, 46 with 8 cells,
41 with 32. Up to 400 sprites a grid hardly shows. Every sprite
holds its own grid.
Tests:
- Gate on melektaus-atx: 220 files, 3416 tests, CHECK EXIT 0.
- 15 new unit tests for the compiler and the grid.
- Four new e2e checks in modules 28 and 30: a fixed offset moves
the picture, 8 cells bend only the lower half where 1 cell shears
it all, Texture alpha is refused at the node, a text moves.
- e2e 28,30 on melektaus-atx: 110 checks, all pass.
- The e2e total of 1699 is counted (1695 + 4), the full suite did
not run.
- No counter-probe, no screenshot. Not looked at: the preview, Time
in the browser, flipped sprites, Padding together with the grid.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>