Shaders: Texture size feeds the Vertex output, scaling (#409)
- Shaders: Texture size is in the list of what may feed the Vertex output, except when fed a Pass's picture. New paragraph "Scaling about the middle" with the formula and the fade from 1.2 to 1.0. - Development: 2009 checks. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent
6fd38bb2d8
commit
4c5823a63f
2 files changed
+15
-8
No files matched your search
+1
-1
@@ -21,7 +21,7 @@ php tests/php/releases.test.php # the release stor
|
||||
php tests/php/files.test.php # uploaded files in a folder per account (#344), the same way
|
||||
php tests/php/videos.test.php # the video store, its queue and the worker (#402), with the
|
||||
# real ffmpeg: the CI image and game-maker-video have it
|
||||
node tools/seed-e2e.mjs && node tools/e2e.mjs # 2008 editor checks, screenshots in /tmp/gm-e2e-*.png
|
||||
node tools/seed-e2e.mjs && node tools/e2e.mjs # 2009 editor checks, screenshots in /tmp/gm-e2e-*.png
|
||||
GM_STEPS=20 node tools/e2e.mjs # or 1-12, or 6,20 — a subset while working on one step
|
||||
./e2e.sh start [GM_STEPS] # the same run detached, see below
|
||||
./e2e.sh status # live progress, or the last run's result
|
||||
|
||||
+14
-7
@@ -79,7 +79,7 @@ plugged into a colour port, straight from a `Number` or a `Luminance` as well.
|
||||
| **UV** | out `u`, `v` | Where this pixel is on the sprite's picture, 0 to 1: `u` left to right, `v` top to bottom. |
|
||||
| **Sample texture** | in `u`, `v` (number), `picture` · out `color`, `alpha` | The picture at another spot, tinted like Texture color. Unconnected, `u` and `v` are this pixel's own and `picture` is the sprite's. Past the border the picture continues as the Output's *Edge* says. |
|
||||
| **Blur** | in `radius` (number, 2), `u`, `v` (number), `picture` · out `color`, `alpha` · *Kind*, *Direction* | The picture softened around a spot, tinted like Texture color. `radius` is in pixels of the picture, 0 to 8, fractions allowed. *Kind* Box (default) weighs every pixel alike, Gaussian the middle more; *Direction* Both, Horizontal or Vertical. Unconnected, `u` and `v` are this pixel's own and `picture` is the sprite's. See *Softening the picture*. |
|
||||
| **Texture size** | in `picture` · out `width`, `height` | The picture in pixels: of the frame, when the sprite wears one. Fed a Pass's `picture`, that one's, Padding included. |
|
||||
| **Texture size** | in `picture` · out `width`, `height` | The picture in pixels: of the frame, when the sprite wears one. Fed a Pass's `picture`, that one's, Padding included. Feeds the Vertex output too. |
|
||||
| **Time** | out `value` | Seconds since the editor started; see *Coordinates and time* below. |
|
||||
| **Output** | in `color`, `alpha` (number) | What the sprite is drawn with: the colour, clamped to 0-1, and the opacity, clamped too. Each input left unconnected stays the texture's. One per graph. Its *Edge* setting says how the picture continues past its border when sampled outside it: *Clamp* (the default) holds the border pixel, *Mirror* turns the picture back on itself, *Repeat* starts it over for tiles, *Transparent* leaves everything outside empty. Its *Padding* is room around the picture to draw into, in pixels of the picture per side (see *Room around the picture*). |
|
||||
| **Pass** | in `color`, `alpha` (number) · out `picture` | Draws what feeds it into a picture of its own first; the nodes with a `picture` input read that picture when it feeds them (see *Drawing in passes*). Unconnected, `color` and `alpha` are the texel's. Its *Resolution* is *Full* (the default), *Half* or *Quarter* of the sprite's picture per side. Up to 8 per graph. |
|
||||
@@ -359,10 +359,17 @@ there are no corners in between, and the whole picture leans instead. For a wave
|
||||
`Sin` of `UV.u` times a frequency plus `Time`, times the height in pixels.
|
||||
|
||||
What may feed it is what a corner can know: `UV` (the corner's own place on the picture), `Time`,
|
||||
`Property`, `Number` and the calculating nodes. A corner has no pixel, so `Texture color`,
|
||||
`Texture alpha`, `Sample texture`, `Blur`, `Texture size`, `Pass`, `Color` and `Color property` cannot feed it; the Vertex output
|
||||
then says "Not available per corner: …" and the shader does not compile. The same node may feed
|
||||
both outputs: one `Property` can drive the bend and the colour.
|
||||
`Property`, `Number`, `Texture size` and the calculating nodes. `Texture size` is there the
|
||||
picture the corner's pixels are counted in, the same numbers it gives a pixel. A corner has no
|
||||
pixel, so `Texture color`, `Texture alpha`, `Sample texture`, `Blur`, `Pass`, `Color` and
|
||||
`Color property` cannot feed it, nor a `Texture size` fed a Pass's picture; the Vertex output then
|
||||
says "Not available per corner: …" and the shader does not compile. The same node may feed both
|
||||
outputs: one `Property` can drive the bend and the colour.
|
||||
|
||||
**Scaling about the middle**, whatever the picture's size: `x` is
|
||||
`(UV.u - 0.5) * Texture size.width * (scale - 1)` and `y` the same with `UV.v` and `height`. For a fade that grows from 1.2 to 1.0, the
|
||||
scale is `Mix` of 1.2 and 1.0 by the fade's `Property`, and the same `Property` feeds the Output's
|
||||
`alpha`. A scale is a straight move of every corner, so *Subdivisions* 1 is enough.
|
||||
|
||||
Who it applies to:
|
||||
|
||||
@@ -377,8 +384,8 @@ when its rectangle is off screen, because its corners may reach in.
|
||||
|
||||
Measured in the checks (steps 28 and 30): a Vertex output fed 16 draws a 32-pixel picture half a
|
||||
sprite to the right; the cut on `v` moves only the lower half with 8 subdivisions and leans the
|
||||
upper half along with 1; `Texture alpha` into `x` is refused at the node; a text's filled quad
|
||||
stands 6 units to the right.
|
||||
upper half along with 1; half of `Texture size.width` moves it as far as 16 does; `Texture alpha`
|
||||
into `x` is refused at the node; a text's filled quad stands 6 units to the right.
|
||||
|
||||
## Wearing a shader
|
||||
|
||||
|
||||
Reference in new issue
Block a user