pixelkiln 0.139.1 → 0.139.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/PARALLAX.md +126 -3
- package/docs/README.md +1 -1
- package/docs/RESEARCH_PARALLAX.md +259 -123
- package/package.json +1 -1
- package/skills/pixelkiln/SKILL.md +3 -2
- package/skills/pixelkiln/references/parallax.md +39 -3
package/docs/PARALLAX.md
CHANGED
|
@@ -4,7 +4,7 @@ A parallax background is a stack of layers that scroll at different speeds as
|
|
|
4
4
|
the camera moves. PixelKiln has no parallax command yet, so this guide builds
|
|
5
5
|
one from ordinary manifest assets and a free script. Everything below was run
|
|
6
6
|
to make the pictures on this page: two biomes, 51 PixelLab generations in all,
|
|
7
|
-
including the retries. The evidence behind each choice is in the
|
|
7
|
+
including the retries, and a climb for a camera that scrolls up. The evidence behind each choice is in the
|
|
8
8
|
[research note](./RESEARCH_PARALLAX.md).
|
|
9
9
|
|
|
10
10
|

|
|
@@ -248,11 +248,134 @@ LDtk counts the other way: its factor is how much the layer follows the
|
|
|
248
248
|
camera, so write 1 − speed. With `parallaxScaling` on it also shrinks a far
|
|
249
249
|
layer off the pixel grid. PixelKiln's LDtk export writes factor 0 today.
|
|
250
250
|
|
|
251
|
+
## 8. Scroll vertically
|
|
252
|
+
|
|
253
|
+
A camera that climbs needs more than the sideways stack. The climb below uses
|
|
254
|
+
the alpine palette, 14 PixelLab generations and one Retro Diffusion picture for
|
|
255
|
+
the loop further down.
|
|
256
|
+
|
|
257
|
+

|
|
258
|
+
|
|
259
|
+
- **Draw layers tall, or place things at height.** The 400×100 strips above are
|
|
260
|
+
made for one height. Climbing past them, the near layer drops out early and
|
|
261
|
+
the far range's extension fills half the view. Give the camera something to
|
|
262
|
+
pass at every height: a tall landmark, clouds scattered up the climb, a wall.
|
|
263
|
+
- **Give every layer headroom.** A layer has to be drawn the view's height plus
|
|
264
|
+
climb × its vertical speed above it. For a 480 px climb that is 48 rows at
|
|
265
|
+
1/10 and all 480 at full speed.
|
|
266
|
+
- **Place the layers for the lowest view.** Then a climb only moves them down
|
|
267
|
+
the screen and never uncovers their feet.
|
|
268
|
+
- **Move the sky.** A sky at speed 0 looks the same at every height. At 0.3 of
|
|
269
|
+
the climb its bands walk from dusk at the horizon to night at the top.
|
|
270
|
+
- **Generate clouds as puffy sprites.** "a single puffy cumulus cloud, pink-lit
|
|
271
|
+
top and blue-violet shaded underside, simple shading, about two thirds as
|
|
272
|
+
wide as the picture, a lone cloud game sprite on a plain empty background,
|
|
273
|
+
nothing else in the picture: no sky, no sun, no moon, no mountains" came back
|
|
274
|
+
usable on three seeds of three. Thin streaks and flat banks did not, on four
|
|
275
|
+
tries.
|
|
276
|
+
- **Build the wall from a pillar.** Asked for a cliff wall, pixflux draws a
|
|
277
|
+
pillar with a summit. `wall` keeps the summit and repeats the body below it
|
|
278
|
+
at the rows where it loops best. Pick the candidate whose ledges are far
|
|
279
|
+
apart, so the repeat is hard to spot.
|
|
280
|
+
|
|
281
|
+
```bash
|
|
282
|
+
# Stack a cliff into a wall 700 rows tall, keeping its top 100 rows as the summit.
|
|
283
|
+
$P wall cliff.png wall.png 700 100
|
|
284
|
+
|
|
285
|
+
# Vertical preview: the camera climbs and comes back.
|
|
286
|
+
STILL=strip.png SCALE=2 $P climb climb.webp climb.json
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
A climb spec is the side-scrolling one with `climb` in place of `travel`,
|
|
290
|
+
`speed_y` on any layer whose vertical speed differs, and two more layer kinds:
|
|
291
|
+
|
|
292
|
+
```jsonc
|
|
293
|
+
{
|
|
294
|
+
"view": [240, 256],
|
|
295
|
+
"sky": ["#040920", "#142b60", "#405e9c", "#a596b9", "#de889c", "#f9b59c"],
|
|
296
|
+
"sky_speed": 0,
|
|
297
|
+
"sky_speed_y": 0.3,
|
|
298
|
+
"stars": 80,
|
|
299
|
+
"climb": 480,
|
|
300
|
+
"layers": [
|
|
301
|
+
{ "image": "far.png", "bottom": 200, "speed": 0.1, "extend": true },
|
|
302
|
+
{ "image": "massif.png", "repeat": false, "x": 60, "bottom": 262, "speed": 0.2, "extend": true },
|
|
303
|
+
{ "scatter": ["puff-a.far.png", "puff-b.far.png"], "top": -520, "bottom": 60, "count": 7, "speed": 0.4 },
|
|
304
|
+
{ "image": "wall.png", "repeat": false, "x": -8, "bottom": 300, "speed": 1 },
|
|
305
|
+
{ "scatter": ["puff-a.png", "puff-b.png"], "top": -720, "bottom": -120, "count": 5, "speed": 1.3 }
|
|
306
|
+
]
|
|
307
|
+
}
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
Rows count from the top of the view at the start of the climb, so negative
|
|
311
|
+
rows are above it. `scatter` places one sprite per height band between `top`
|
|
312
|
+
and `bottom`. An image with `"repeat_y": true` repeats upward instead of
|
|
313
|
+
sideways.
|
|
314
|
+
|
|
315
|
+
For a background that scrolls up forever, such as a vertical shooter's,
|
|
316
|
+
generate it with Retro Diffusion's `tileY` on `rd_plus__default` and no
|
|
317
|
+
background removal. It wraps vertically; pixflux has no seamless option. Keep
|
|
318
|
+
the rest of the set on that picture's colours: snapped to a palette with few of
|
|
319
|
+
its colours, the sky below kept 5 of its 47.
|
|
320
|
+
|
|
321
|
+

|
|
322
|
+
|
|
323
|
+
The same layer at a quarter of the camera's speed both ways:
|
|
324
|
+
|
|
325
|
+
| Tool | Setting |
|
|
326
|
+
|---|---|
|
|
327
|
+
| Tiled | `parallaxx: 0.25`, `parallaxy: 0.25`; `repeaty` on an image layer that loops |
|
|
328
|
+
| Godot 4 | `Parallax2D.scroll_scale = Vector2(0.25, 0.25)`; `repeat_size.y` for a loop |
|
|
329
|
+
| Phaser 3 | `setScrollFactor(0.25, 0.25)` |
|
|
330
|
+
| LDtk | `parallaxFactorX: 0.75`, `parallaxFactorY: 0.75` with `parallaxScaling: false` |
|
|
331
|
+
|
|
332
|
+
The specs, manifests and build script are in
|
|
333
|
+
[`benchmarks/parallax-vertical`](../benchmarks/parallax-vertical), and step 19
|
|
334
|
+
of the [research note](./RESEARCH_PARALLAX.md) has the numbers.
|
|
335
|
+
|
|
336
|
+
## 9. A second time of day
|
|
337
|
+
|
|
338
|
+
To show the same place at another time, recolour the finished set instead of
|
|
339
|
+
generating it again. A palette swap keeps every shape, so the two times line up
|
|
340
|
+
when the game fades from one to the other, and it costs nothing.
|
|
341
|
+
|
|
342
|
+

|
|
343
|
+
|
|
344
|
+
1. Take a palette for the new time the way you took the first one. The night
|
|
345
|
+
palette here is the 42 colours of PixelLab's mountain valley, sent again
|
|
346
|
+
with the same prompt and seed and "at night" in place of "at dusk".
|
|
347
|
+
2. Swap each finished piece onto it by luminance rank, the far range, layers,
|
|
348
|
+
landforms and tier copies alike:
|
|
349
|
+
|
|
350
|
+
```bash
|
|
351
|
+
$P recolour far.png far.night.png dusk.manifest.json night.manifest.json cool
|
|
352
|
+
```
|
|
353
|
+
|
|
354
|
+
`cool` leaves out the new palette's light colours, those whose red is above
|
|
355
|
+
their blue: lit windows, lamplight and the moon. Without it, pink-lit snow
|
|
356
|
+
turns orange.
|
|
357
|
+
3. Draw the sky from the new palette.
|
|
358
|
+
|
|
359
|
+
Generating the set again on the new palette also gives layers that agree, but
|
|
360
|
+
in a different place. Every peak moves. "At night" in a prompt also brought a
|
|
361
|
+
moon or stars into 7 of 9 pictures, two of them despite "no moon, no stars" in
|
|
362
|
+
the prompt. Generate only
|
|
363
|
+
what the new time adds, such as a moon, as its own sprite. A swap keeps the
|
|
364
|
+
light where the first time put it, which suits dusk to night; light from
|
|
365
|
+
another side needs new pictures. The manifests and build script are in
|
|
366
|
+
[`benchmarks/parallax-night`](../benchmarks/parallax-night).
|
|
367
|
+
|
|
251
368
|
## What this guide does not cover
|
|
252
369
|
|
|
253
370
|
- Splitting a finished scene into layers. A depth model and inpainting can do
|
|
254
371
|
it, at 10 to 25 PixelLab generations a layer for the fill; see steps 4, 13
|
|
255
372
|
and 14 of the [research note](./RESEARCH_PARALLAX.md).
|
|
256
|
-
- Retro Diffusion
|
|
257
|
-
|
|
373
|
+
- Retro Diffusion for sideways layers, beyond this. Its environment style
|
|
374
|
+
draws a whole scene whatever the prompt says (step 15). `rd_plus__default`
|
|
375
|
+
with `tileX`, no background removal and "a plain flat chroma-key green
|
|
376
|
+
background" in the prompt gives a layer that loops as generated, once the
|
|
377
|
+
background is keyed out by script (`parallax.py key`). Retro Diffusion's own
|
|
378
|
+
background removal breaks the seam. The default style drew a flat background
|
|
379
|
+
on 2 of 3 tries, and its colours are its own, so the rest of the set has to
|
|
380
|
+
follow them (step 21).
|
|
258
381
|
- A `pixelkiln parallax` command. The research note sketches one.
|
package/docs/README.md
CHANGED
|
@@ -29,7 +29,7 @@ provider you are using. These Markdown files also render at
|
|
|
29
29
|
| [Environment provider benchmark](./PROVIDER_BENCHMARK.md) | Compare PixelLab, Retro Diffusion, and ComfyUI on buildings, backgrounds, cleanup, and native-grid recovery. |
|
|
30
30
|
| [3D characters from sprites](./CHARACTERS_3D.md) | An experimental pipeline from directional sprites to a rigged, animated 3D character with separate items: a pixel path and a painted path, the steps, and what each costs. Scripts, not a command. |
|
|
31
31
|
| [Research: 3D models from sprites](./RESEARCH_3D.md) | Every attempt to turn eight directional sprites into a 3D model, with pictures. Research, not a feature. |
|
|
32
|
-
| [Parallax backgrounds](./PARALLAX.md) | Build a scrolling background in layers from one palette: silhouettes or whole layers from PixelLab, the prompts that work, finishing by script, a preview, and engine settings. |
|
|
32
|
+
| [Parallax backgrounds](./PARALLAX.md) | Build a scrolling background in layers from one palette, sideways or climbing: silhouettes or whole layers from PixelLab, the prompts that work, finishing by script, a preview, and engine settings. |
|
|
33
33
|
| [Research: parallax backgrounds](./RESEARCH_PARALLAX.md) | The evidence behind the parallax guide: every way tried to build a background in depth and to get its layers out of a generator. Research, not a feature. |
|
|
34
34
|
| [Controlled asset revisions](./REVISIONS.md) | Image-to-image and inpaint edits, PixelLab palette cleanup, animation, skeleton posing, and interpolation from a parent asset; masks, approval gates, side-by-side review, and ComfyUI bindings. |
|
|
35
35
|
| [Derived artifacts](./ARTIFACTS.md) | Refine, pack, mount, and export; provenance, approval gates, ownership, and crash recovery. |
|
|
@@ -1,69 +1,74 @@
|
|
|
1
1
|
# Parallax backgrounds
|
|
2
2
|
|
|
3
|
-
This is a research note, not a feature
|
|
3
|
+
This is a research note, not a feature. Nothing here is a PixelKiln command, and the scripts are rough.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
PixelKiln can generate a scenic background as one flat picture. A parallax background is several layers that scroll at different speeds as the camera moves. This note tries the ways to build one and the ways to get the layers out of AI generators. Steps 1 to 11 use art we already had. Step 12 records how a game that already uses PixelKiln builds its skyline. Steps 13 to 16 spent 17 PixelLab generations and $0.24 of Retro Diffusion. Step 17 ran a layer-splitting model on our own 12 GB GPU. Step 18 spent 51 PixelLab generations turning the two routes that worked into the sets below. Step 19 turns the camera upward, with 14 PixelLab generations and $0.12 of Retro Diffusion. Step 20 takes the alpine set to night with 10 PixelLab generations, and step 21 spent $0.30 of Retro Diffusion on seamless layers keyed by script.
|
|
6
|
+
|
|
7
|
+
The short version is that generators are good at one isolated shape and bad at agreeing across several pictures, so ask them for shapes and do the agreeing yourself. Steps 12 and 18 show how. To build a background, follow the [parallax guide](./PARALLAX.md). This note is the evidence behind it. A picture stays in this note only if it shows a result worth using or the one fault a step found. The rest is in the text and the scripts.
|
|
6
8
|
|
|
7
9
|

|
|
8
10
|
|
|
9
11
|

|
|
10
12
|
|
|
11
|
-
Last updated
|
|
13
|
+
Last updated 24 November 2026.
|
|
12
14
|
|
|
13
15
|
## Summary
|
|
14
16
|
|
|
15
17
|
| # | Approach | Tool or model | Result | Verdict |
|
|
16
18
|
|---|---|---|---|---|
|
|
17
|
-
| 1 | Check whether our backgrounds wrap horizontally | Our script | 9 of 10 benchmark backgrounds show a seam 1.3 to 5.6 times the normal
|
|
18
|
-
| 2 | Make a flat picture loop with no new generation | Our script | A cut at matching columns, a crossfade snapped to the palette, or a mirror image
|
|
19
|
-
| 3 | Split a flat picture into depth layers by distance from the sky colour | Our script | Recombines exactly, but the bands follow colour, not distance
|
|
20
|
-
| 4 | Split by a depth model's map | Depth Anything V2 Small, CPU, under 1.2 s a picture | Clean bands on the two PixelLab landscapes
|
|
21
|
-
| 5 | Pan a camera over the layers | Our script | Reads as depth.
|
|
22
|
-
| 6 | Grow each near layer upward | Our script | The stray
|
|
23
|
-
| 7 | Scroll each row at its own speed instead of using layers | Our script | Good on ground that recedes to a horizon
|
|
24
|
-
| 8 | Measure atmospheric perspective by depth band | Our script | PixelLab's scenes get closer to the sky colour with distance
|
|
19
|
+
| 1 | Check whether our backgrounds wrap horizontally | Our script | 9 of 10 benchmark backgrounds show a seam 1.3 to 5.6 times the normal step between neighbouring columns | None of them loops as generated. |
|
|
20
|
+
| 2 | Make a flat picture loop with no new generation | Our script | A cut at matching columns, a crossfade snapped to the palette, or a mirror image each closes the seam with no new colours | Keep the cut and the crossfade. Both repeat a picture with a clear focal point. |
|
|
21
|
+
| 3 | Split a flat picture into depth layers by distance from the sky colour | Our script | Recombines exactly, but the bands follow colour, not distance. The volcano is cut in half. | Drop. |
|
|
22
|
+
| 4 | Split by a depth model's map | Depth Anything V2 Small, CPU, under 1.2 s a picture | Clean bands on the two PixelLab landscapes. A scene framed by tall trees cannot be split this way. | Keep for open landscapes. |
|
|
23
|
+
| 5 | Pan a camera over the layers | Our script | Reads as depth. Two faults: outlines left behind, and a plume that drags a strip of sky with it. | Keep, with a 2 px grow (step 6). |
|
|
24
|
+
| 6 | Grow each near layer upward | Our script | The stray outlines are gone. The plume fault stays. | Keep. |
|
|
25
|
+
| 7 | Scroll each row at its own speed instead of using layers | Our script | Good on ground that recedes to a horizon. Shears anything tall. | Keep for floors, water and valleys. |
|
|
26
|
+
| 8 | Measure atmospheric perspective by depth band | Our script | PixelLab's scenes get closer to the sky colour with distance. Retro Diffusion's and ComfyUI's do not. | Push far layers back by hand (step 9). |
|
|
25
27
|
| 9 | Push a layer toward the sky colour with the palette held | Our script | Contrast down a third, no new colours | Keep. |
|
|
26
|
-
| 10 | Round layer offsets so they never move when the camera does not | Simulation | Rounding each layer's own position moves layers 3 to 25 times while the camera stands still
|
|
27
|
-
| 11 | Read what LDtk does with a parallax factor | LDtk source | A layer moves on screen at 1 − factor of the camera, and
|
|
28
|
-
| 12 | Build layers from separate silhouettes instead of cutting one picture | A game using PixelKiln, Godot 4; our script to replay it | Three generated silhouettes a biome, laid in overlapping runs in two hazed tiers over a shader sky
|
|
29
|
-
| 13 | Cut by depth per pixel instead of per column | Depth Anything V2 Small, our script | The plume moves on its own and the sky stays whole
|
|
30
|
-
| 14 | Inpaint what a near layer hid | PixelLab `inpaint_image`, 10 generations | Forest and slope in place of smears
|
|
31
|
-
| 15 | Generate each layer on its own, wide | PixelLab pixflux with one forced palette, 4 generations; Retro Diffusion environment with `tile_x`, $0.24 | PixelLab's four layers agree and scroll as one scene
|
|
32
|
-
| 16 | Generate silhouettes and compose a skyline from them | PixelLab pixflux, 3 generations; our script | Usable landforms, but none fades at the foot as asked, so each run ends on a hard dark base | Keep the route
|
|
33
|
-
| 17 | Ask a layer-splitting model for the layers | Qwen-Image-Layered fp8 in ComfyUI, RTX 3060 12 GB, 35 to 42 minutes a picture | The sky and sun come apart from the land with the hidden sun filled in
|
|
34
|
-
| 18 | Refine steps 12, 15 and 16
|
|
28
|
+
| 10 | Round layer offsets so they never move when the camera does not | Simulation | Rounding each layer's own position moves layers 3 to 25 times while the camera stands still. Rounding the camera first moves them 0 times. | Keep. Round the camera first. |
|
|
29
|
+
| 11 | Read what LDtk does with a parallax factor | LDtk source | A layer moves on screen at 1 − factor of the camera, and LDtk shrinks it to that scale unless `parallaxScaling` is off | Export pixel art with `parallaxScaling: false`. |
|
|
30
|
+
| 12 | Build layers from separate silhouettes instead of cutting one picture | A game using PixelKiln, Godot 4; our script to replay it | Three generated silhouettes a biome, laid in overlapping runs in two hazed tiers over a shader sky. The layers only ever rise from where they were placed. | Keep. The best route we found. Nothing is cut, so nothing hidden has to be invented. |
|
|
31
|
+
| 13 | Cut by depth per pixel instead of per column | Depth Anything V2 Small, our script | The plume moves on its own and the sky stays whole. The cheap fill smears sideways where a framing tree moves away. | Keep the per-pixel cut. The fill needs step 14. |
|
|
32
|
+
| 14 | Inpaint what a near layer hid | PixelLab `inpaint_image`, 10 generations | Forest and slope in place of smears, nothing outside the mask changed, 2 new colours | Keep for a scene that has to be split. |
|
|
33
|
+
| 15 | Generate each layer on its own, wide | PixelLab pixflux with one forced palette, 4 generations; Retro Diffusion environment with `tile_x`, $0.24 | PixelLab's four layers agree and scroll as one scene. Retro Diffusion's each draw a whole scene, and background removal breaks the seam `tile_x` made. | Keep PixelLab with a shared palette. Retro Diffusion's environment style is not a layer generator. |
|
|
34
|
+
| 16 | Generate silhouettes and compose a skyline from them | PixelLab pixflux, 3 generations; our script | Usable landforms, but none fades at the foot as asked, so each run ends on a hard dark base | Keep the route. The foot needs a cleanup pass, which step 18 adds. |
|
|
35
|
+
| 17 | Ask a layer-splitting model for the layers | Qwen-Image-Layered fp8 in ComfyUI, RTX 3060 12 GB, 35 to 42 minutes a picture | The sky and sun come apart from the land, with the hidden sun filled in. Far range, volcano, near ridges and lava stay in one layer. A blank fill layer and a pink blob take the other slots. | Drop for parallax. It splits sky from scene, not near from far, and it is too slow on this card. |
|
|
36
|
+
| 18 | Refine steps 12, 15 and 16 with better prompts, three candidates each, and finishing by script | PixelLab pixflux, 51 generations over two biomes; our script | A sprite-style prompt gives isolated landforms where a scene-style one did not. A dithered foot, a tint per tier and a scripted sky turn them into stacks that read as one scene. | Keep. This is the route the [parallax guide](./PARALLAX.md) teaches. |
|
|
37
|
+
| 19 | Scroll vertically: a climb, and a loop that scrolls up forever | PixelLab pixflux, 14 generations; Retro Diffusion `rd_plus__default` with `tile_y`, $0.12; our script | Sideways strips run out within a quarter of a climb. Tall layers, clouds placed up the climb, a sky that moves and a wall stacked from a generated cliff read as one climb. `tile_y` wraps vertically. | Keep. Every layer needs headroom of climb × its vertical speed. |
|
|
38
|
+
| 20 | A second time of day: generate the alpine set again on a night palette, or recolour the dusk set | PixelLab pixflux, 10 generations; our script | Regenerated layers stay on the palette and agree, but 7 of 9 drew a moon or stars and every peak moved. A palette swap by luminance rank gives the same place at night, free. | Recolour for a second time of day. Generate only what the new time adds. |
|
|
39
|
+
| 21 | Retro Diffusion `tile_x` without background removal, keyed by script | Retro Diffusion `rd_plus__default` and `rd_plus__environment`, $0.30; our script | Keyed layers join with seam ratios of 0.3 to 1.4, against 3.9 with `remove_bg`. The default style drew a flat background on 2 of 3 layers; the environment style drew a sky behind both of its layers. | Keep, with `rd_plus__default`. A transparent layer that loops as generated. |
|
|
35
40
|
|
|
36
41
|
## Ways to make the effect
|
|
37
42
|
|
|
38
43
|
There are six ways to make a background move with depth. Most games combine two of them.
|
|
39
44
|
|
|
40
|
-
**Layers composed from separate sprites.**
|
|
45
|
+
**Layers composed from separate sprites.** The engine assembles each layer from several transparent silhouettes, generated one at a time and laid side by side with overlap, flips and jitter. Nothing is cut from a finished scene, so nothing hidden behind a near layer has to be invented. A layer is as wide as the run, not the generator's canvas. Step 12 is a working example.
|
|
41
46
|
|
|
42
|
-
**Separate layers.** Each depth is its own picture, scrolled at a fraction of the camera's speed
|
|
47
|
+
**Separate layers.** Each depth is its own picture, scrolled at a fraction of the camera's speed, and the far layer moves least. This is the standard approach, and every editor and engine supports it directly. The usual split is sky, far range, middle ground, near ground and foreground occluders. That is our reading of common practice; we found no source that states it as a rule. An artist's guide asks for "several layers" and cares more about balance than a fixed count ([Pixelblog 23](https://www.slynyrd.com/blog/2019/11/12/pixelblog-23-parallax-scrolling)). Godot's tutorial uses five ([Godot 2D parallax](https://docs.godotengine.org/en/stable/tutorials/2d/2d_parallax.html)).
|
|
43
48
|
|
|
44
49
|
**Line scroll (raster scroll).** One picture, with each row scrolled at its own speed. The Mega Drive's video chip can scroll each line or each 8 pixel row of a plane on its own ([Sega Retro](https://segaretro.org/Sega_Mega_Drive/Scrolling)), and the SNES does it through HDMA ([nesdev HDMA examples](https://snes.nesdev.org/wiki/HDMA_examples)). It suits ground that recedes to a horizon, water and cloud bands. It shears anything tall (step 7).
|
|
45
50
|
|
|
46
|
-
**Pseudo-3D floors (Mode 7).**
|
|
51
|
+
**Pseudo-3D floors (Mode 7).** The hardware scales a floor plane differently on every line, so it recedes in perspective ([nesdev Mode 7](https://snes.nesdev.org/wiki/Mode_7_transform)). It belongs to racing and overhead games more than to side-scrolling backgrounds. Out of scope here.
|
|
47
52
|
|
|
48
|
-
**Depth-map displacement (2.5D).** One picture and a depth map
|
|
53
|
+
**Depth-map displacement (2.5D).** One picture and a depth map. A shader moves each pixel by its depth, as in Facebook's 3D photos. Facebook's format fills the gaps that open with heuristics tuned for phones, and learned fill tends to look "too smooth" ([Shih et al. 2020](https://arxiv.org/abs/2004.04727v3)). For pixel art we expect resampling to break the grid and the filled gaps to break the palette. We have not tested that. Discrete layers keep both, so we did not pursue this one.
|
|
49
54
|
|
|
50
|
-
**Pointer or tilt parallax.** The same layers, driven by the mouse or the device's tilt in a menu or title screen instead of by a camera.
|
|
55
|
+
**Pointer or tilt parallax.** The same layers, driven by the mouse or the device's tilt in a menu or title screen instead of by a camera. Only the input differs.
|
|
51
56
|
|
|
52
57
|
## Ways to get the layers out of a generator
|
|
53
58
|
|
|
54
59
|
| Route | What it needs | Status here |
|
|
55
60
|
|---|---|---|
|
|
56
|
-
| Generate silhouettes and compose each layer from them in the engine | A few transparent landforms a biome, each fading out at its foot
|
|
57
|
-
| Generate each layer on its own, with a transparent background | A prompt per layer
|
|
58
|
-
| Generate one picture and split it with a depth model | A depth model and a fill for what the near layers hid | Steps 4 to 6, 13 and 14. |
|
|
59
|
-
| A model that outputs layers directly | LayerDiffuse on SDXL, or Qwen-Image-Layered | Step 17
|
|
60
|
-
| A wide picture that wraps, then cut into layers | A provider's seamless option, or step 2 on the result | Retro Diffusion's `tile_x`
|
|
61
|
+
| Generate silhouettes and compose each layer from them in the engine | A few transparent landforms a biome, each fading out at its foot, and placement rules in the game | Step 12 is in use in a game. Step 18 made two working sets with PixelLab. |
|
|
62
|
+
| Generate each layer on its own, with a transparent background | A prompt per layer. The layers must agree in palette, light and horizon. | Steps 15 and 18. A forced palette shared by every layer is what makes them agree. |
|
|
63
|
+
| Generate one picture and split it with a depth model | A depth model, and a fill for what the near layers hid | Steps 4 to 6, 13 and 14. |
|
|
64
|
+
| A model that outputs layers directly | LayerDiffuse on SDXL, or Qwen-Image-Layered | Step 17. Qwen-Image-Layered splits sky from scene, not by distance, and takes over half an hour a picture on a 12 GB card. LayerDiffuse is untried. Neither is trained on pixel art. |
|
|
65
|
+
| A wide picture that wraps, then cut into layers | A provider's seamless option, or step 2 on the result | Retro Diffusion's `tile_x` and `tile_y` are the only hosted seamless flags we found. Step 19 loops a sky vertically with `tile_y`. Step 21 keeps the `tile_x` seam on a transparent layer by keying the background out by script. |
|
|
61
66
|
|
|
62
67
|
## 1. Do our backgrounds wrap?
|
|
63
68
|
|
|
64
69
|
**Question.** A parallax layer usually repeats sideways forever. Do the backgrounds PixelKiln already generates join up when placed end to end?
|
|
65
70
|
|
|
66
|
-
**Setup.** `parallax.py seam` on the ten scenic backgrounds from the [provider benchmark](./PROVIDER_BENCHMARK.md). The seam is the mean absolute RGB difference between the last column and the first.
|
|
71
|
+
**Setup.** `parallax.py seam` on the ten scenic backgrounds from the [provider benchmark](./PROVIDER_BENCHMARK.md). The seam is the mean absolute RGB difference between the last column and the first. The script divides it by the median difference between neighbouring columns inside the picture. A ratio near 1 means the join is no rougher than the picture itself.
|
|
67
72
|
|
|
68
73
|
**Result.**
|
|
69
74
|
|
|
@@ -80,7 +85,7 @@ There are six ways to make a background move with depth. Most games combine two
|
|
|
80
85
|
| Retro Diffusion alpine valley B | 43.1 | 7.7 | 5.6 |
|
|
81
86
|
| Retro Diffusion volcanic pass B | 22.7 | 6.3 | 3.6 |
|
|
82
87
|
|
|
83
|
-
The one low ratio is
|
|
88
|
+
The one low ratio is luck. Retro Diffusion's alpine valley A has near-black trees down both edges, so its first and last columns already match.
|
|
84
89
|
|
|
85
90
|
**Verdict.** No benchmark background loops as generated, and none was asked to. A layer has to be made to loop, either when it is generated or afterwards.
|
|
86
91
|
|
|
@@ -88,11 +93,11 @@ The one low ratio is a coincidence of composition: Retro Diffusion's alpine vall
|
|
|
88
93
|
|
|
89
94
|
**Question.** Can a picture that does not wrap be made to, without a new generation and without new colours?
|
|
90
95
|
|
|
91
|
-
**Setup.** `parallax.py loop` with three methods, on PixelLab's alpine valley A (256×256) and volcanic pass A (384×384)
|
|
96
|
+
**Setup.** `parallax.py loop` with three methods, on PixelLab's alpine valley A (256×256) and volcanic pass A (384×384).
|
|
92
97
|
|
|
93
|
-
- **Cut
|
|
94
|
-
- **Crossfade
|
|
95
|
-
- **Mirror
|
|
98
|
+
- **Cut.** Find the two columns at least 60% of the width apart where the right one best continues into the left, and crop to them.
|
|
99
|
+
- **Crossfade.** Blend the last eighth of the width into the first eighth, drop the last eighth, and snap every blended pixel to the nearest colour already in the picture.
|
|
100
|
+
- **Mirror.** Place the picture next to its mirror image.
|
|
96
101
|
|
|
97
102
|
**Result.**
|
|
98
103
|
|
|
@@ -104,66 +109,66 @@ The one low ratio is a coincidence of composition: Retro Diffusion's alpine vall
|
|
|
104
109
|
|
|
105
110
|

|
|
106
111
|
|
|
107
|
-
**Verdict.** The cut and the crossfade both make a loop that holds up at the join. The mirror closes the seam perfectly and
|
|
112
|
+
**Verdict.** The cut and the crossfade both make a loop that holds up at the join. The mirror closes the seam perfectly and gives itself away at once with its symmetry. All three expose the bigger problem. A scenic picture has a focal point, and a peak or volcano that comes round again every few seconds is obvious. A loop wants a layer with no single landmark, which is also Pixelblog 23's advice. Landmarks belong on a layer of their own that does not repeat, or repeats rarely.
|
|
108
113
|
|
|
109
114
|
## 3. Split by distance from the sky colour
|
|
110
115
|
|
|
111
116
|
**Question.** Distant things in a landscape are closer to the sky colour. Is that enough to cut a flat picture into depth layers, with no model?
|
|
112
117
|
|
|
113
|
-
**Setup.** `parallax.py split <png> <out> 4`. Nearness is each pixel's RGB distance from the median colour of the top rows, median-filtered over 5×5. A 1D k-means finds three cut points. For each cut,
|
|
118
|
+
**Setup.** `parallax.py split <png> <out> 4`. Nearness is each pixel's RGB distance from the median colour of the top rows, median-filtered over 5×5. A 1D k-means finds three cut points. For each cut, the skyline is the first row in each column where nearness stays above the cut for three rows, kept in depth order. Layer *k* is everything from its skyline down. Where a nearer layer hid it, the script fills the gap by reflecting the layer's own rows, so a revealed gap shows its texture rather than a smear. Composited at rest, the layers rebuild the source exactly, and the script checks this.
|
|
114
119
|
|
|
115
|
-
**Result.** On the volcano
|
|
120
|
+
**Result.** On the volcano the bands follow colour. The lit flank of the volcano lands in one band, its shadowed flank in another, and the sun gets a band of its own.
|
|
116
121
|
|
|
117
|
-
**Verdict.** Drop. Colour
|
|
122
|
+
**Verdict.** Drop. Colour stops standing in for distance as soon as a scene has its own light.
|
|
118
123
|
|
|
119
124
|
## 4. Split by a depth model
|
|
120
125
|
|
|
121
126
|
**Question.** Does a monocular depth model give bands that follow the scene's real depth?
|
|
122
127
|
|
|
123
|
-
**Setup.** `depth.py` runs [Depth Anything V2 Small](https://github.com/DepthAnything/Depth-Anything-V2)
|
|
128
|
+
**Setup.** `depth.py` runs [Depth Anything V2 Small](https://github.com/DepthAnything/Depth-Anything-V2) through Hugging Face Transformers 5.24 and PyTorch 2.15 on a Mac's CPU. The model has 24.8M parameters and is Apache-2.0; the larger checkpoints are CC-BY-NC-4.0. The script enlarges the picture twice with nearest neighbour first, then shrinks the map back to the picture's size. The split is the same as step 3, with the map as nearness.
|
|
124
129
|
|
|
125
130
|
**Result.** Under 1.2 s a picture. On both PixelLab landscapes the bands follow the scene: sky and distant range, the volcano or the far valley, the middle ridges, and the near ridges or trees.
|
|
126
131
|
|
|
127
132
|

|
|
128
133
|
|
|
129
|
-
Retro Diffusion's alpine valley A is the exception. Tall trees frame it from
|
|
134
|
+
Retro Diffusion's alpine valley A is the exception. Tall trees frame it from top to bottom on both sides. A skyline split assumes the near ground starts lower in every column than whatever is behind it. Here it puts the whole frame in the nearest layer, along with the full column above it, and most of each layer would have to be invented as the camera moves.
|
|
130
135
|
|
|
131
|
-
The script also counts the pixels a layer
|
|
136
|
+
The script also counts the pixels a layer lacks but would show if the layer in front moved a twelfth of the picture's width relative to it (32 px on the volcano). The fill has to make these pixels up. With the depth map they come to 15 to 40% of a layer on the PixelLab pictures, and 29 to 101% on the framed Retro Diffusion one. The count is an upper bound and depends on how far the camera travels.
|
|
132
137
|
|
|
133
|
-
**Verdict.** Keep, for open landscapes composed
|
|
138
|
+
**Verdict.** Keep, for open landscapes that were composed in layers to begin with. A scene composed for one frame needs per-pixel layers and a real fill (steps 13 and 14).
|
|
134
139
|
|
|
135
140
|
## 5. Pan a camera over the layers
|
|
136
141
|
|
|
137
142
|
**Question.** Do the depth-model layers read as depth when they move, and what breaks?
|
|
138
143
|
|
|
139
|
-
**Setup.** `parallax.py preview
|
|
144
|
+
**Setup.** `parallax.py preview` moves the four layers at 0.1, 0.3, 0.6 and 1.0 of the camera's movement. The view is three quarters of the picture wide, the pan is 96 px and eased over 60 frames, and offsets are rounded as in step 10.
|
|
140
145
|
|
|
141
|
-
**Result.** It reads as depth
|
|
146
|
+
**Result.** It reads as depth. The volcano drifts against the sky and the near ridges sweep across it. Two faults show at the far end of the pan (left, before step 6).
|
|
142
147
|
|
|
143
|
-
- **Outlines left behind.** Each ridge's dark outline sits just above its skyline, so
|
|
144
|
-
- **The plume drags a strip of sky.** The depth model puts the smoke nearer than the sky behind it.
|
|
148
|
+
- **Outlines left behind.** Each ridge's dark outline sits just above its skyline, so the split assigned it to the layer behind. When the ridge moves, its outline stays put as a stray line.
|
|
149
|
+
- **The plume drags a strip of sky.** The depth model puts the smoke nearer than the sky behind it. A layer here is everything below a skyline, so the strip of sky between the smoke and the volcano's slope moves with the volcano.
|
|
145
150
|
|
|
146
151
|

|
|
147
152
|
|
|
148
|
-
**Verdict.** Keep, with step 6. Floating things
|
|
153
|
+
**Verdict.** Keep, with step 6. Floating things such as smoke, clouds, birds and a moon have to be cut out as their own sprites instead of riding a skyline.
|
|
149
154
|
|
|
150
155
|
## 6. Grow each near layer
|
|
151
156
|
|
|
152
157
|
**Question.** Does lifting each skyline a couple of pixels make the near shapes take their outlines with them?
|
|
153
158
|
|
|
154
|
-
**Setup.** `GROW=2
|
|
159
|
+
**Setup.** `GROW=2`, and 4, on the split. Each skyline moves up by that many rows before the layers are cut.
|
|
155
160
|
|
|
156
|
-
**Result.** At 2 px the stray lines are gone (picture above, right). 4 px looks no better, so the smaller grow
|
|
161
|
+
**Result.** At 2 px the stray lines are gone (picture above, right). 4 px looks no better, so we kept the smaller grow. The plume fault from step 5 is unchanged, as expected.
|
|
157
162
|
|
|
158
163
|
**Verdict.** Keep 2 px.
|
|
159
164
|
|
|
160
165
|
## 7. Scroll each row instead
|
|
161
166
|
|
|
162
|
-
**Question.** For a scene that is mostly ground receding to a horizon, is per-row scrolling
|
|
167
|
+
**Question.** For a scene that is mostly ground receding to a horizon, is per-row scrolling cheaper than layers, with nothing to cut or fill?
|
|
163
168
|
|
|
164
|
-
**Setup.** `parallax.py line <png> <out> <horizon-row>`. Rows above the horizon move at 0.15 of the camera
|
|
169
|
+
**Setup.** `parallax.py line <png> <out> <horizon-row>`. Rows above the horizon move at 0.15 of the camera. Below it the factor rises to 1.0 at the bottom row along a 1.5 power curve. The horizon is row 100 of 256 for the alpine valley and row 150 of 384 for the volcano.
|
|
165
170
|
|
|
166
|
-
**Result.** The alpine valley's forested floor and river sweep convincingly, with no gaps to fill. The volcano shows the limit
|
|
171
|
+
**Result.** The alpine valley's forested floor and river sweep past convincingly, with no gaps to fill. The volcano shows the limit. Its cone and the near ridges stand across many rows, each row slides by a different amount, and they lean.
|
|
167
172
|
|
|
168
173
|

|
|
169
174
|
|
|
@@ -171,9 +176,9 @@ The script also counts the pixels a layer does not have but would show if the la
|
|
|
171
176
|
|
|
172
177
|
## 8. Do generators already push the distance back?
|
|
173
178
|
|
|
174
|
-
**Question.** Atmospheric perspective makes distant layers lower in contrast and closer to the sky colour
|
|
179
|
+
**Question.** Atmospheric perspective makes distant layers lower in contrast and closer to the sky colour. That is a summary of several art guides, such as [Pinnguaq](https://pinnguaq.com/?p=1295), not checked against each one. Do the generated backgrounds already do this, so the layers can be used as cut?
|
|
175
180
|
|
|
176
|
-
**Setup.** `parallax.py bands <png> 4 <depth.png
|
|
181
|
+
**Setup.** `parallax.py bands <png> 4 <depth.png>` gives, for each depth band, the standard deviation of luminance and the mean RGB distance from the sky colour.
|
|
177
182
|
|
|
178
183
|
**Result.** Distance from the sky colour, far band to near band:
|
|
179
184
|
|
|
@@ -186,25 +191,25 @@ The script also counts the pixels a layer does not have but would show if the la
|
|
|
186
191
|
|
|
187
192
|
Luminance contrast does not fall steadily with distance in any of them.
|
|
188
193
|
|
|
189
|
-
**Verdict.** PixelLab's scenes are lit for depth
|
|
194
|
+
**Verdict.** PixelLab's scenes are lit for depth. Retro Diffusion's night canyon and the ComfyUI benchmark are not. The ComfyUI output was never reduced to a palette, so its colour counts are not comparable. Layers cut from a picture that is not lit for depth need pushing back by hand.
|
|
190
195
|
|
|
191
196
|
## 9. Push a layer back
|
|
192
197
|
|
|
193
198
|
**Question.** Can a layer be pushed toward the sky colour without adding colours?
|
|
194
199
|
|
|
195
|
-
**Setup.** `parallax.py haze <layer.png> <out.png> 0.35
|
|
200
|
+
**Setup.** `parallax.py haze <layer.png> <out.png> 0.35` mixes each pixel 35% toward the sky colour, then snaps it to the nearest colour already in the layer.
|
|
196
201
|
|
|
197
202
|
**Result.** On the alpine valley's second layer, luminance contrast falls from 21.8 to 14.6, and the layer uses 19 of its 35 colours. No colour is new.
|
|
198
203
|
|
|
199
204
|

|
|
200
205
|
|
|
201
|
-
**Verdict.** Keep. The snap
|
|
206
|
+
**Verdict.** Keep. The snap limits the layer to colours it already has. To push toward a sky colour the layer lacks, add the sky's colours to its palette first.
|
|
202
207
|
|
|
203
208
|
## 10. Rounding
|
|
204
209
|
|
|
205
|
-
**Question.** Pixel art has to move in whole pixels
|
|
210
|
+
**Question.** Pixel art has to move in whole pixels, and a layer at a factor of 0.3 sits at a fractional position most of the time. Which rounding keeps layers from twitching when the camera stops?
|
|
206
211
|
|
|
207
|
-
**Setup.** `parallax.py jitter` simulates a camera that follows a character walking 120 px in 3 s, then stops and settles with a small overshoot: 360 frames at 60 fps. It counts the frames where a layer moves a pixel while the rounded camera does not.
|
|
212
|
+
**Setup.** `parallax.py jitter` simulates a camera that follows a character walking 120 px in 3 s, then stops and settles with a small overshoot: 360 frames at 60 fps. It counts the frames where a layer moves a pixel while the rounded camera does not. It compares two schemes. One rounds each layer's own position, `round(cam × f)`. The other rounds the camera and takes the layer from it, `floor(round(cam) × f)`.
|
|
208
213
|
|
|
209
214
|
**Result.**
|
|
210
215
|
|
|
@@ -218,15 +223,15 @@ Luminance contrast does not fall steadily with distance in any of them.
|
|
|
218
223
|
|
|
219
224
|
At a steady 1 px a frame, factors 0.25 and 0.5 step every 4 and 2 frames. Factors 0.3, 0.4, 0.6 and 0.75 step on an uneven rhythm, such as 3, 3, 4 for 0.3.
|
|
220
225
|
|
|
221
|
-
**Verdict.** Round the camera to whole pixels first and derive every layer from that.
|
|
226
|
+
**Verdict.** Round the camera to whole pixels first and derive every layer from that. Where an even rhythm matters, prefer simple fractions (1/2, 1/4, 1/8). An artist's guide comes at it from the other end with whole pixels per frame and loop widths with many divisors, such as 96 ([Pixelblog 23](https://www.slynyrd.com/blog/2019/11/12/pixelblog-23-parallax-scrolling)).
|
|
222
227
|
|
|
223
228
|
## 11. What LDtk does with a parallax factor
|
|
224
229
|
|
|
225
230
|
**Question.** PixelKiln's LDtk export writes `parallaxFactorX: 0`, `parallaxFactorY: 0` and `parallaxScaling: true` on every layer ([`ldtk-export.ts`](../src/pipeline/ldtk-export.ts)). What would a non-zero factor do?
|
|
226
231
|
|
|
227
|
-
**Setup.**
|
|
232
|
+
**Setup.** We read the LDtk source. `Camera.getParallaxOffsetX` returns `levelX * parallaxFactorX`, minus half the layer's width times the factor when scaling is off ([Camera.hx](https://github.com/deepnight/ldtk/blob/master/src/electron.renderer/display/Camera.hx)). `LayerDef.getScale` returns `1 - parallaxFactorX` when `parallaxScaling` is on and the factor is not zero ([LayerDef.hx](https://github.com/deepnight/ldtk/blob/master/src/electron.renderer/data/def/LayerDef.hx)). The schema gives the range as -1 to 1, default 0 ([JSON schema](https://ldtk.io/files/JSON_SCHEMA.json)).
|
|
228
233
|
|
|
229
|
-
**Result.**
|
|
234
|
+
**Result.** LDtk offsets the layer by the camera position times the factor, so on screen it moves at 1 − factor of the camera's speed. 0 is an ordinary layer. A positive factor is farther away, and 1 never moves. A negative factor is nearer than the level. With `parallaxScaling` on, LDtk also draws the layer at 1 − factor of its size, so a far layer shrinks.
|
|
230
235
|
|
|
231
236
|
The same layer, at a quarter of the camera's speed, in each tool:
|
|
232
237
|
|
|
@@ -236,47 +241,47 @@ The same layer, at a quarter of the camera's speed, in each tool:
|
|
|
236
241
|
| Tiled | `parallaxx: 0.25` | [Tiled manual](https://doc.mapeditor.org/en/latest/manual/layers/) |
|
|
237
242
|
| Godot 4 `Parallax2D` | `scroll_scale = Vector2(0.25, 1)` | [Godot class reference](https://docs.godotengine.org/en/stable/classes/class_parallax2d.html) |
|
|
238
243
|
| Phaser 3 | `setScrollFactor(0.25, 1)` | [Phaser API](https://docs.phaser.io/api-documentation/3.90.0/namespace/gameobjects-components-scrollfactor) |
|
|
239
|
-
| Unity | Scripted
|
|
244
|
+
| Unity | Scripted. We found no official parallax package. | None |
|
|
240
245
|
|
|
241
|
-
**Verdict.** LDtk counts the other way from every other tool here
|
|
246
|
+
**Verdict.** LDtk counts the other way from every other tool here. Its factor is how much the layer follows the camera, not how fast it moves, so an exporter has to write 1 − speed. It also has to set `parallaxScaling: false` for pixel art, or LDtk draws a far layer at a fraction of its size and off the pixel grid. Not yet checked in the LDtk editor itself.
|
|
242
247
|
|
|
243
248
|
## 12. Layers built from separate silhouettes
|
|
244
249
|
|
|
245
|
-
**Question.** Steps 3 to 6 cut one picture into layers and then have to invent what the near layers hid. A game that uses PixelKiln does the opposite
|
|
250
|
+
**Question.** Steps 3 to 6 cut one picture into layers and then have to invent what the near layers hid. A game that uses PixelKiln does the opposite and composes each layer from separate sprites. How is it built, and what does it settle that splitting does not?
|
|
246
251
|
|
|
247
|
-
**Setup.**
|
|
252
|
+
**Setup.** We read the game's Godot 4 source (its backdrop and sky scripts and their tests) and did not run the game. The game is top-down with an isometric look. The camera can pan north past the playfield's edge to look at the skyline, so the movement is mostly vertical. `parallax.py compose` replays the layout and the offsets outside the engine to check the numbers.
|
|
248
253
|
|
|
249
254
|
**Result.** How it is put together:
|
|
250
255
|
|
|
251
|
-
- **The art is silhouettes, not scenes.** Each biome has three landforms, generated one at a time from prompts of the form "distant <landform>, fading to nothing at its foot, hazy dusk lighting as if seen from far away, no ground plane, no sky, isolated landform only, transparent background". The first set
|
|
252
|
-
- **A layer is a run of those silhouettes.** Each next sprite starts 72% of the way across the one before it, plus a random gap of up to 16 px, so the shapes overlap into one skyline instead of reading as a row of objects. Each sprite is flipped at random, the same one never comes twice in a row, and the feet jitter ±12 px.
|
|
253
|
-
- **Two tiers.** The far tier stands 40 px deeper than the near one. Both are tinted toward the biome's dusk colour, the far one by 0.5 and the near one by 0.3.
|
|
254
|
-
- **The sky is not generated.** It is a shader
|
|
255
|
-
- **Movement.** The playfield moves 1:1 with the camera. The sky follows at 0.6, the far tier at 0.85 and the near tier at 0.92. The offset is `round((1 − rate) × clamp(viewTop − edge, −360, 0))`, where 360 px is how far the camera may look past the edge. The x offset
|
|
256
|
-
- **Anchored so nothing ever sinks.** At the southernmost view that can see the skyline, every layer sits exactly where it
|
|
257
|
-
- **The gap under a rising layer is ground, not sky.** A rising tier would open a strip above the playfield. A thin "skirt" of distant ground fills it: the biome's ground colour hazed 0.2 toward the horizon band, 24 px solid with a 12 px stepped fade above and below. Its top rides with the tier and its foot stays put. The sky's top rises while its foot stays fixed, so its bottom edge never shows. Nothing
|
|
258
|
-
- **No loop.** The world is bounded, so each run
|
|
259
|
-
- **Heat shimmer** in hot biomes moves each band of three texel rows sideways by whole texels, stepped at the game's 8 fps animation rate
|
|
256
|
+
- **The art is silhouettes, not scenes.** Each biome has three landforms, generated one at a time from prompts of the form "distant <landform>, fading to nothing at its foot, hazy dusk lighting as if seen from far away, no ground plane, no sky, isolated landform only, transparent background". The first set came from PixelLab at 224 to 256 px wide. They were later redrawn at 768×336 through Scenario, with the bottom 30% faded to transparent so the foot dissolves into the haze instead of ending on a hard edge. A forest or jungle biome has none, because its treeline is its horizon.
|
|
257
|
+
- **A layer is a run of those silhouettes.** Each next sprite starts 72% of the way across the one before it, plus a random gap of up to 16 px, so the shapes overlap into one skyline instead of reading as a row of objects. Each sprite is flipped at random, the same one never comes twice in a row, and the feet jitter ±12 px. The game places them with a seeded generator of their own, so adding a landform never moves anything else.
|
|
258
|
+
- **Two tiers.** The far tier stands 40 px deeper than the near one. Both are tinted toward the biome's dusk colour, the far one by 0.5 and the near one by 0.3. The aerial perspective comes from the tint, not from the art (compare step 9). A dust storm pales both further.
|
|
259
|
+
- **The sky is not generated.** It is a shader with four flat colour bands for each time of day, each nudged toward a colour for the biome's air, and clouds, an overcast deck, or stars and a moon drawn over the bands. The same sky colour tints the playfield a little, so the two agree.
|
|
260
|
+
- **Movement.** The playfield moves 1:1 with the camera. The sky follows at 0.6, the far tier at 0.85 and the near tier at 0.92. The offset is `round((1 − rate) × clamp(viewTop − edge, −360, 0))`, where 360 px is how far the camera may look past the edge. The x offset has the same shape, centred on the playfield. Offsets are whole world pixels, and a world pixel is one texel at every zoom the game allows.
|
|
261
|
+
- **Anchored so nothing ever sinks.** At the southernmost view that can see the skyline, every layer sits exactly where it would with parallax off. From there the layers only rise. So the game's rule that a tree's foot must stand in front of the mountains' base holds at every camera position.
|
|
262
|
+
- **The gap under a rising layer is ground, not sky.** A rising tier would open a strip above the playfield. A thin "skirt" of distant ground fills it: the biome's ground colour hazed 0.2 toward the horizon band, 24 px solid with a 12 px stepped fade above and below. Its top rides with the tier and its foot stays put. The sky's top rises while its foot stays fixed, so its bottom edge never shows. Nothing floats.
|
|
263
|
+
- **No loop.** The world is bounded, so each run extends past both ends of the playfield by the most that layer can drift, `(1 − rate) × reach`, plus a 400 px margin. No side edge shows and no seam is needed (compare steps 1 and 2).
|
|
264
|
+
- **Heat shimmer** in hot biomes moves each band of three texel rows sideways by whole texels, stepped at the game's 8 fps animation rate. That is line scroll (step 7) used for an effect rather than for depth.
|
|
260
265
|
|
|
261
|
-
**Tuning.** The first prototype moved the layers at 0.3, 0.5 and 0.75, each tier with a 64 px skirt. The owner's review was that less could be more. At full headroom the old rates lift the sky, far and near layers 252, 180 and 90 px, against 144, 54 and 29 px for the current ones
|
|
266
|
+
**Tuning.** The first prototype moved the layers at 0.3, 0.5 and 0.75, each tier with a 64 px skirt. The owner's review was that less could be more. At full headroom the old rates lift the sky, far and near layers 252, 180 and 90 px, against 144, 54 and 29 px for the current ones, and `compose` gives the same figures from the formula. Close rates keep the two tiers together, so no band of sky opens between them. One thin skirt replaced two wide ones that had read as haze between the layers and the playfield.
|
|
262
267
|
|
|
263
|
-
**Open check.** The
|
|
268
|
+
**Open check.** The game rounds the offsets from the camera's own, unrounded view top. Step 10 found that this moves a layer while the camera is still, unless the camera's position is already whole pixels. The game snaps 2D transforms to pixels and snaps its smoothed view onto its target, but we did not check whether the view top is ever fractional while it settles.
|
|
264
269
|
|
|
265
|
-
**Verdict.** Keep. This is the most practical route in this note. Generators are good at one isolated shape on a transparent background and poor at agreeing across several pictures
|
|
270
|
+
**Verdict.** Keep. This is the most practical route in this note. Generators are good at one isolated shape on a transparent background and poor at agreeing across several pictures, and this route asks them only for the first. Splitting a picture (steps 3 to 6) is still the route when you have one finished scene to animate.
|
|
266
271
|
|
|
267
272
|
## 13. Cut by depth per pixel
|
|
268
273
|
|
|
269
|
-
**Question.** Steps 4 to 6 cut along one skyline per column
|
|
274
|
+
**Question.** Steps 4 to 6 cut along one skyline per column. That fails on a scene framed by tall trees and drags sky along with anything floating. Does assigning each pixel to its own depth band fix both?
|
|
270
275
|
|
|
271
|
-
**Setup.** `parallax.py cut <png> <out> 4 <depth.png> <reach>`, with `GROW=2`. Each pixel goes to its band from the Depth Anything map
|
|
276
|
+
**Setup.** `parallax.py cut <png> <out> 4 <depth.png> <reach>`, with `GROW=2`. Each pixel goes to its band from the Depth Anything map. A 3×3 median then removes specks, and each near band takes 2 px from the bands behind it (step 6). The script fills a layer only where it could be uncovered, meaning hidden pixels within `reach` px of something at its depth or farther. Reach is the pan, 96 px on the volcano and 64 on the framed valley. The fill copies the nearest pixel of the layer's own in the same row, then the nearest in any direction. The script writes each layer's invented pixels as a mask for step 14.
|
|
272
277
|
|
|
273
|
-
**Result.** Both pictures recombine exactly at rest. On the volcano the plume now moves with its own band and the sky behind it stays sky (right; the skyline cut of step 6 on the left). The framed valley no longer loses whole columns to the trees.
|
|
278
|
+
**Result.** Both pictures recombine exactly at rest. On the volcano the plume now moves with its own band, and the sky behind it stays sky (right; the skyline cut of step 6 is on the left). The framed valley no longer loses whole columns to the trees.
|
|
274
279
|
|
|
275
280
|

|
|
276
281
|
|
|
277
282
|

|
|
278
283
|
|
|
279
|
-
The price is invention.
|
|
284
|
+
The price is invention. Because the bands are thin and the pan is long, the fill has to make up 115 to 189% of a layer's own pixel count on the volcano and 175 to 333% on the framed valley. Where a framing tree slides away, the cheap fill shows as sideways smears (step 14, left).
|
|
280
285
|
|
|
281
286
|
**Verdict.** Keep the per-pixel cut. The fill is the weak part.
|
|
282
287
|
|
|
@@ -284,9 +289,9 @@ The price is invention. The fill has to make up 115 to 189% of a layer's own pix
|
|
|
284
289
|
|
|
285
290
|
**Question.** Can a hosted inpainting model replace the smeared fill with something that belongs in the scene, without changing the pixels around it?
|
|
286
291
|
|
|
287
|
-
**Setup.** The framed valley's third layer
|
|
292
|
+
**Setup.** The framed valley's third layer, the trees and cabins in the middle ground, whose fill covers 22,794 pixels. The input was layers 0 to 2 composited, so the model sees an opaque picture, and the mask was the invented pixels from step 13. PixelLab `inpaint_image` at 256×256, seed 4242, `crop_to_mask` on, with the description "the valley floor continuing behind: pine trees, grassy riverbank and distant mountain slopes in the same pixel-art style and colours, no large tree trunks in the foreground". 10 generations.
|
|
288
293
|
|
|
289
|
-
**Result.** No pixel outside the mask changed. The fill used 31 colours, 2 of them
|
|
294
|
+
**Result.** No pixel outside the mask changed. The fill used 31 colours, 2 of them new to the picture. At the far end of the pan, the smears to the left of the cabin and along the mountain's edge became forest and slope (right). The two farther layers still carry the cheap fill.
|
|
290
295
|
|
|
291
296
|

|
|
292
297
|
|
|
@@ -296,19 +301,19 @@ The price is invention. The fill has to make up 115 to 189% of a layer's own pix
|
|
|
296
301
|
|
|
297
302
|
**Question.** Instead of cutting a scene, can each layer be generated as its own wide picture that agrees with the others and wraps?
|
|
298
303
|
|
|
299
|
-
**Setup.** One volcanic dusk set from each hosted provider
|
|
304
|
+
**Setup.** One volcanic dusk set from each hosted provider, with a sky, a far range, a volcano and near ridges. The manifests are in [`benchmarks/parallax-layers`](../benchmarks/parallax-layers).
|
|
300
305
|
|
|
301
|
-
- **PixelLab** through PixelKiln
|
|
302
|
-
- **Retro Diffusion
|
|
306
|
+
- **PixelLab** through PixelKiln, using pixflux, `view: side`, seed 4242, and one forced palette for every layer (the 44 colours of the step 4 volcano). The sky is 400×160 and opaque. The three layers are 400×100 with background removal, under pixflux's 40,000 px transparency limit. 4 generations.
|
|
307
|
+
- **Retro Diffusion** with `rd_plus__environment` and `tile_x`, seed 4242. The sky is 384×160 and the layers are 384×96 with `remove_bg`, at $0.06 an image, $0.24 in all. PixelKiln refused to send these at the time. Retro Diffusion quoted $0.06 for every size tried, above PixelKiln's offline estimate of $0.044 for 384×96, so we sent the four straight to the API with the same quote check. PixelKiln 0.138.1 plans every `rd_plus__` style at the flat $0.06, so it would send them now.
|
|
303
308
|
|
|
304
|
-
|
|
309
|
+
Pixflux has no seamless option, so we looped the PixelLab layers with step 2's crossfade. Both sets were stacked with their bottoms on rows 150, 175 and 200 of a 200 px canvas, and scrolled one way at 0.05, 0.25, 0.5 and 1.0 so every seam passes.
|
|
305
310
|
|
|
306
311
|
**Result.**
|
|
307
312
|
|
|
308
|
-
- **PixelLab
|
|
309
|
-
- **Retro Diffusion
|
|
313
|
+
- **PixelLab reads as one scene.** Same palette, same light, and a clean cutout on all three layers (60 to 71% transparent). The far range came back as a flat two-colour silhouette, so it reads as a band of fog. The sky drew a mountain and hills along its bottom despite "no mountains".
|
|
314
|
+
- **Retro Diffusion does not.** The environment style draws a whole scene whatever the prompt says. The sky has its own volcano and river, the far layer is a range with sky still on it, and the near layer is a wall. `tile_x` does work on the drawing, and the sky wraps with a seam no rougher than its inside (ratio 1.0). Background removal then breaks it. The near layer keeps ground on one side of the join and removes it on the other (seam ratio 3.9).
|
|
310
315
|
|
|
311
|
-
**Verdict.** Keep PixelLab pixflux with one forced palette for every layer
|
|
316
|
+
**Verdict.** Keep PixelLab pixflux with one forced palette for every layer. It is the cheapest route in this note, and the layers agree. Retro Diffusion's environment style is a scene generator, not a layer generator. Its `tile_x` is still the only hosted seamless option we found, and would suit a sky or any layer that needs no background removal. Step 18 fixes the fog-band far range and the sky with mountains in it, and its pictures replace this step's.
|
|
312
317
|
|
|
313
318
|
## 16. A skyline from generated silhouettes
|
|
314
319
|
|
|
@@ -316,47 +321,47 @@ The PixelLab layers were looped with step 2's crossfade, because pixflux has no
|
|
|
316
321
|
|
|
317
322
|
**Setup.** Three PixelLab pixflux silhouettes at 200×100, background removed, on the step 15 palette, with prompts in step 12's pattern: "a distant <landform>, fading to nothing at its foot, hazy dusk light as if seen from far away, no ground plane, no sky, isolated landform only". 3 generations. `parallax.py compose` laid them in runs at three times their size, with step 12's rates (0.6, 0.85, 0.92) and the camera panning north.
|
|
318
323
|
|
|
319
|
-
**Result.** The landforms are usable and cut out cleanly, 44 to 73% transparent. None fades at the foot
|
|
324
|
+
**Result.** The landforms are usable and cut out cleanly, 44 to 73% transparent. None fades at the foot. Pixel-art background removal leaves each pixel fully on or fully off, so each landform comes back with a hard dark base, a disc under the cone and a plateau under the mesa. In a run those bases read as a black band where step 12's game shows haze.
|
|
320
325
|
|
|
321
|
-
**Verdict.** Keep the route. The faded foot has to come from somewhere else
|
|
326
|
+
**Verdict.** Keep the route. The faded foot has to come from somewhere else. The options are a generator that returns soft alpha (the game's redraws came from Scenario), a dithered fade drawn afterwards, or a skirt and treeline in front, as step 12's game uses. Step 18 draws the dithered fade and finds the prompt that gives isolated landforms.
|
|
322
327
|
|
|
323
328
|
## 17. A model that splits a picture into layers
|
|
324
329
|
|
|
325
330
|
**Question.** [Qwen-Image-Layered](https://github.com/QwenLM/Qwen-Image-Layered) is trained to break a picture into RGBA layers and fill in what each layer hides. Does it give depth bands, and does it run on a 12 GB card?
|
|
326
331
|
|
|
327
|
-
**Setup.** ComfyUI 0.34 on an RTX 3060 (12 GB) with 32 GB of RAM, using the fp8 model (20.5 GB), the fp8 Qwen 2.5 VL 7B text encoder and the layered VAE
|
|
332
|
+
**Setup.** ComfyUI 0.34 on an RTX 3060 (12 GB) with 32 GB of RAM, using the fp8 model (20.5 GB), the fp8 Qwen 2.5 VL 7B text encoder and the layered VAE, about 30 GB of downloads. We enlarged the step 4 volcano from 384 to 640 px by nearest neighbour and ran it through the official "Image to Layers" graph as an API workflow: euler, 50 steps, CFG 4.0, seed 42, a short description of the scene as the prompt. One run asked for 4 layers, one for 3.
|
|
328
333
|
|
|
329
334
|
**Result.**
|
|
330
335
|
|
|
331
|
-
- **It runs, slowly.** The model does not fit beside the desktop's own use of the card, so ComfyUI streams the weights from system RAM every step
|
|
336
|
+
- **It runs, slowly.** The model does not fit beside the desktop's own use of the card, so ComfyUI streams the weights from system RAM every step. That is about 40 s a step, 35 minutes for 4 layers and 42 for 3.
|
|
332
337
|
- **The split is sky against everything else.** In both runs the back layer is a flat near-white fill and one layer holds the sky and sun. A single layer holds the far range, the volcano and its plume, the near ridges and the lava. The 4-layer run spent its extra slot on a pink blob over the lower half that matches nothing in the scene. Nothing in front can move at a different speed from anything behind it.
|
|
333
|
-
- **What it does well.**
|
|
334
|
-
- **It is not pixel art afterwards.** The input has 44 colours
|
|
338
|
+
- **What it does well.** It fills in the sun behind the volcano on the sky layer, which is the work step 14 paid PixelLab to do. Stacked back to front, the layers rebuild the input to within 3.5 of 255 per channel on average.
|
|
339
|
+
- **It is not pixel art afterwards.** The input has 44 colours. Each layer has 22,000 to 50,000, and the scene layer's alpha is mostly 192 to 254 rather than fully opaque. Every layer would need snapping back to the palette and a hard alpha.
|
|
335
340
|
|
|
336
|
-
|
|
341
|
+
We did not try other prompts, other seeds or the full-precision model. The model's documentation says the prompt does not choose what goes in each layer.
|
|
337
342
|
|
|
338
|
-
**Verdict.** Drop for parallax. It separates the objects a person would select, not the distances a camera would see, and a picture takes over half an hour on this card.
|
|
343
|
+
**Verdict.** Drop for parallax. It separates the objects a person would select, not the distances a camera would see, and a picture takes over half an hour on this card. For a picture that has to be split, use a depth map (steps 4 and 13) with inpainting (step 14).
|
|
339
344
|
|
|
340
345
|
## 18. Refine the two routes that worked
|
|
341
346
|
|
|
342
|
-
**Question.** Steps 12, 15 and 16 found two routes worth keeping, but their pictures were weak
|
|
347
|
+
**Question.** Steps 12, 15 and 16 found two routes worth keeping, but their pictures were weak. The silhouettes had hard dark bases, the far range read as a band of fog, and the sky had mountains drawn into it. How good can they get with better prompts, a choice of candidates, and finishing by script?
|
|
343
348
|
|
|
344
|
-
**Setup.** Two biomes, each on one forced palette
|
|
349
|
+
**Setup.** Two biomes, each on one forced palette. Volcanic dusk uses the 44 colours of the step 4 volcano, and alpine dusk the 38 colours of PixelLab's alpine valley A. Every asset was generated through PixelKiln at three seeds (101, 202, 303): three silhouettes at 256×128 and three whole layers (far, middle, near) at 400×100, all pixflux with background removal and `view: side`. That is 36 generations. The silhouette retries cost 9 more volcanic and 6 more alpine, 51 in all. The manifests, lockfiles, preview specs and build script are in [`benchmarks/parallax-refined`](../benchmarks/parallax-refined). We did not generate the sky. `parallax.py sky` draws six flat palette bands with a dithered step between neighbours.
|
|
345
350
|
|
|
346
351
|
**Result.**
|
|
347
352
|
|
|
348
|
-
- **The prompt decides whether a silhouette is a sprite or a scene.** The first round used step 16's pattern
|
|
353
|
+
- **The prompt decides whether a silhouette is a sprite or a scene.** The first round used step 16's pattern, with "distant", "hazy dusk light as if seen from far away" and "fading to nothing at its foot". All nine volcanic silhouettes came back as small scenes, with ground, clouds or a moon. 14 of the 18 silhouettes over both biomes ran off the side of the canvas, and pixflux drew a glow asked for at a crater as a setting sun. The retry described one object as "a lone landform game sprite on a plain empty background", listed what must not be in the picture, asked for "about two thirds as wide as the picture", and left out the distance and the glow. All 15 retries came back as one isolated landform each, and 14 were clear of both sides. The fifteenth, a ridge, touched the right edge at its foot, where the dithered fade thins it out anyway.
|
|
349
354
|
|
|
350
355
|

|
|
351
356
|
|
|
352
|
-
- **Whole layers came back usable on the first round.** Every far range was a flat one-colour band, which suits the farthest layer once it is recoloured. The alpine middle and near layers (sunlit peaks, a pine treeline) were good on every seed. Every volcanic middle layer was a single volcano,
|
|
353
|
-
- **A dithered foot replaces soft alpha.** `parallax.py foot` trims a silhouette and thins its bottom 30% with a 4×4 ordered dither
|
|
357
|
+
- **Whole layers came back usable on the first round.** Every far range was a flat one-colour band, which suits the farthest layer once it is recoloured. The alpine middle and near layers (sunlit peaks, a pine treeline) were good on every seed. Every volcanic middle layer was a single volcano. Looped, it would repeat obviously, so the preview draws it once as a landmark.
|
|
358
|
+
- **A dithered foot replaces soft alpha.** `parallax.py foot` trims a silhouette and thins its bottom 30% with a 4×4 ordered dither. The foot dissolves into whatever is behind it and stays pixel art.
|
|
354
359
|
|
|
355
360
|

|
|
356
361
|
|
|
357
|
-
- **Each tier needs its own tint target.** `parallax.py tint` mixes a picture toward a colour and snaps it to the biome palette. Tinting both tiers toward one light haze colour made the near tier lighter than the far range behind it, so depth read backwards. Pulling the far tier toward a mid violet and the near tier toward a dark one gives the right order
|
|
358
|
-
- **A sparse palette flattens a pale tint.** The alpine palette has few pale colours, so snow tinted toward the haze snapped to two or three colours. The alpine near tier keeps its snow
|
|
359
|
-
- **
|
|
362
|
+
- **Each tier needs its own tint target.** `parallax.py tint` mixes a picture toward a colour and snaps it to the biome palette. Tinting both tiers toward one light haze colour made the near tier lighter than the far range behind it, so depth read backwards. Pulling the far tier toward a mid violet and the near tier toward a dark one gives the right order, with the far range lightest and the near layer darkest.
|
|
363
|
+
- **A sparse palette flattens a pale tint.** The alpine palette has few pale colours, so snow tinted toward the haze snapped to two or three colours. The alpine near tier keeps its snow with a light tint (0.2) instead.
|
|
364
|
+
- **Extend the far range down instead of floating it.** Repeating the far range's bottom row to the foot of the view gives the tiers' dithered feet distant land to dissolve into. A flat haze band in its place read as a separate rectangle.
|
|
360
365
|
|
|
361
366
|

|
|
362
367
|
|
|
@@ -364,11 +369,108 @@ Other prompts, seeds and the full-precision model were not tried. The model's do
|
|
|
364
369
|
|
|
365
370
|
The four previews scroll the whole stack 480 px and back at 0, 1/8, 1/4, 1/2 and 1 of the camera's speed. They are lossless animated WebP, about 1.1 MB each against 2.3 to 3.2 MB as GIF.
|
|
366
371
|
|
|
367
|
-
**Verdict.** Keep both routes, finished this way. Generate silhouettes as sprites, never as distant scenery, and add the distance afterwards with a palette-held tint per tier. Draw the sky. Take two or three seeds of everything
|
|
372
|
+
**Verdict.** Keep both routes, finished this way. Generate silhouettes as sprites, never as distant scenery, and add the distance afterwards with a palette-held tint per tier. Draw the sky yourself. Take two or three seeds of everything. Only 15 of the 51 candidates made it into the previews, and none came from the first silhouette round. The [parallax guide](./PARALLAX.md) walks through it.
|
|
373
|
+
|
|
374
|
+
## 19. Scroll vertically
|
|
375
|
+
|
|
376
|
+
**Question.** Every step so far moves the camera sideways, apart from step 12's pan north. A platformer's camera also rises and falls, and a climbing level or a vertical shooter scrolls up the whole time. What changes when the camera climbs?
|
|
377
|
+
|
|
378
|
+
**Setup.** `parallax.py climb` is a vertical preview. Each layer has its own vertical speed, and the camera climbs and comes back down, eased and rounded to whole pixels first (step 10). Three tests, with the manifests, lockfiles, preview specs and build script in [`benchmarks/parallax-vertical`](../benchmarks/parallax-vertical):
|
|
379
|
+
|
|
380
|
+
- **Free.** Step 18's alpine whole layers, climbing 240 px in a 256×240 view.
|
|
381
|
+
- **A climb set** on the alpine palette. PixelLab pixflux with background removal at seeds 101, 202 and 303: a tall massif (200×200), puffy clouds (160×96), thin cloud streaks (192×48) and a cliff (128×304), then two flat cloud banks (256×64) as a retry. 14 generations, one of which failed. The preview climbs 480 px in a 240×256 view.
|
|
382
|
+
- **A loop for a vertical shooter.** Retro Diffusion `rd_plus__default` with `tile_y` and no background removal: a 192×384 sky and a 128×384 cliff, $0.12.
|
|
383
|
+
|
|
384
|
+
**Result.**
|
|
385
|
+
|
|
386
|
+
- **Sideways strips run out.** Step 18's layers are 100 px tall and made to be seen from one height. On the free climb the treeline drops out of the view within the first quarter, and the far range, extended down as step 18 does, becomes a flat lilac block filling the lower half of the view. A climb needs layers drawn tall, or things placed at height for the camera to pass.
|
|
387
|
+
- **Every layer needs headroom of climb × its vertical speed.** A layer has to be drawn the view's height plus that many rows above it. On the 480 px climb that is 48 rows for the far range at 0.1, 96 for the massif at 0.2, 192 for the far clouds at 0.4, 480 for the wall at 1.0 and 624 for the foreground clouds at 1.3. It is step 12's rule for a bounded level turned on its side: extend each layer by the most it can drift. Placed for the lowest view, the layers only move down the screen as the camera climbs, so nothing under a layer is ever uncovered. A camera that drops below that view uncovers their feet, which is why step 12 anchors at the southernmost view.
|
|
388
|
+
- **A sky that changes with height has to move.** A sky at infinity, speed 0, looks the same however high the camera goes. Scrolling the sky's bands at 0.3 of the climb walks the view from dusk at the horizon through blue to night at the top, where the script scatters single-pixel stars over the top third.
|
|
389
|
+
- **Clouds work as puffy sprites, not as flat ones.** All three puffy clouds came back isolated and usable on the sprite prompt from step 18. The thin streaks and flat banks did not: four of four came back as a small mound, a one-pixel line, or a bank with a yellow sun rising out of it. Two of the three massifs ignored "no clouds" and came with clouds attached. The third, a tall peak cut off by the right and bottom edges, is the one used, with its cut left edge hidden behind the wall. Placed one per height band up the climb, the clouds give the camera something to pass at every height: tinted toward the haze at 0.4, and as generated at 1.3, in front of the wall.
|
|
390
|
+
|
|
391
|
+

|
|
392
|
+
|
|
393
|
+
- **A cliff comes back as a pillar with a top, which is what a climb needs.** None of the three cliffs filled the picture from top to bottom as asked; each has a summit. `parallax.py wall` keeps the summit, finds the two rows where the body best loops (step 2's cut turned on its side) and repeats the body below. The seam ratios are 2.8 to 8.3. On cliff b, whose ledges are far apart, the join is hard to find. On the other two a repeated ledge of trees or a horizontal line gives it away.
|
|
394
|
+
|
|
395
|
+

|
|
396
|
+
|
|
397
|
+

|
|
398
|
+
|
|
399
|
+
- **Retro Diffusion's `tile_y` works on `rd_plus__default`.** Stacked on themselves, the cliff joins with a seam ratio of 1.1 and the sky 1.9. Sideways the same pictures are not seamless (6.4 and 10.0), as expected. The sky is in Retro Diffusion's own violets. Snapped to the alpine palette it kept 5 of its 47 colours and turned blotchy, so the loop keeps the sky as generated and snaps the PixelLab clouds to the sky's colours instead.
|
|
400
|
+
|
|
401
|
+

|
|
402
|
+
|
|
403
|
+
The engine settings carry over from step 11 on the other axis. Tiled has `parallaxy`, and `repeaty` on an image layer. Godot's `Parallax2D` takes the y of `scroll_scale` and `repeat_size`. Phaser's `setScrollFactor(x, y)` takes both. LDtk's `getParallaxOffsetY` is the same formula as x with `parallaxFactorY`, so write 1 − speed there too. Its shrink follows only `parallaxFactorX`, so a layer with only a vertical factor never shrinks.
|
|
404
|
+
|
|
405
|
+
**Verdict.** Keep. A vertical level needs tall layers or things placed at height, a sky that moves, and headroom of climb × vertical speed on every layer, placed for the lowest view. Generate clouds as puffy sprites and a cliff as a pillar, then stack the pillar's body into the wall. For a background that scrolls up forever, Retro Diffusion's `tile_y` is the one generator option that wraps vertically; keep the rest of the set on its colours.
|
|
406
|
+
|
|
407
|
+
## 20. A second time of day
|
|
408
|
+
|
|
409
|
+
**Question.** Step 18's alpine set is dusk, on a forced palette of 38 colours. A game with a day cycle wants the same place at another time. Does forcing one palette on every layer keep a set consistent at a different time of day? And is generating the set again any better than recolouring the dusk set by script, which is free?
|
|
410
|
+
|
|
411
|
+
**Setup.** We chose night over midday. It moves the colours furthest from dusk, from warm sunlit snow to cold moonlit snow, so it is the harder test for both a forced palette and a recolour. The manifests, lockfiles, preview specs and build script are in [`benchmarks/parallax-night`](../benchmarks/parallax-night).
|
|
412
|
+
|
|
413
|
+
- **The palette.** The dusk palette is the 38 colours of PixelLab's alpine valley A from the provider benchmark. For night we sent the same prompt and seed (31415) with "at dusk" changed to "at night", and took all 42 colours of the result. That is 1 generation. The night palette has the same origin as the dusk one, and it holds what PixelLab paints at night: a navy sky, pale blue snow, lit windows and a moon.
|
|
414
|
+
- **Regenerated.** Step 18's three whole layers at seeds 101 and 202, and its three landforms at seed 202, with the night palette forced on every one. The prompts are step 18's with "at night" added and the light changed: "lit pink by the setting sun" became "lit pale blue by the moon", and the landforms' "pink-lit snow" became "moonlit pale blue snow", with "no stars" added to their list. 9 generations, 10 with the palette, none failed.
|
|
415
|
+
- **Recoloured.** `parallax.py recolour` swaps one palette for another by luminance rank. Both palettes are sorted dark to light, and a colour a given share of the way up the dusk palette becomes the colour the same share of the way up the night palette. Every finished dusk piece from step 18 goes through the same table: the far range, the middle layer, the treeline, the landforms and their tier copies. No generation.
|
|
416
|
+
|
|
417
|
+
Both night sets use the same scripted sky of six night palette bands and step 18's preview spec.
|
|
418
|
+
|
|
419
|
+

|
|
420
|
+
|
|
421
|
+
**Result.**
|
|
422
|
+
|
|
423
|
+
- **The forced palette holds.** All nine regenerated pictures use only night palette colours, and each seed's three layers agree in colour and light, as step 15 and 18 found at dusk.
|
|
424
|
+
- **"At night" brings a moon.** Five of the six layers drew a moon, stars or both; their prompts said only "no sky". Two of the three landforms drew a moon and stars although the prompt said "no moon, no stars", and the same two stand on a pale ground line two rows deep. `parallax.py isolate` keeps the largest shape and whatever touches the bottom row. It cleared the moon and stars from six of the seven pictures. On the seventh, seed 101's treeline, the moon sits behind a treetop.
|
|
425
|
+
- **The far range changes character.** At dusk every far range came back as a flat band of one colour. At night seed 202 gave a two-tone range, 12 colours once the moon was gone, and seed 101 a whole scene with its own treeline and moon.
|
|
426
|
+
- **The regenerated set is a different place.** The picks, all seed 202, read as one scene. No peak stands where it stood at dusk, so a game that fades from dusk to night would show the mountains move.
|
|
427
|
+
- **The recoloured set is the same place at night.** Every shape stays, so dusk and night line up exactly. The set is consistent by construction, because every piece goes through one table. Colour counts barely change. The middle layer goes from 26 colours to 24 and the treeline from 19 to 18, where two dusk colours land on one night colour.
|
|
428
|
+
- **Leave the lights out of the swap.** Onto all 42 night colours, the pink-lit snow took the colours of the lit windows and turned orange (middle row below). The night palette has 8 colours whose red is above their blue: the windows, the lamplight on the ground and the moon. Swapped onto the other 34, the snow is cold and moonlit (bottom row).
|
|
429
|
+
|
|
430
|
+

|
|
431
|
+
|
|
432
|
+
- **The recolour keeps dusk's light.** The lit faces stay where the low sun put them, and read as moonlight from the same side. A palette swap cannot move the light, so a time of day lit from another direction would need new pictures. We did not try one.
|
|
433
|
+
|
|
434
|
+

|
|
435
|
+
|
|
436
|
+

|
|
437
|
+
|
|
438
|
+
The silhouette route behaves the same way. Step 18's runs recoloured keep their shapes, and the three regenerated landforms, cleaned and with the ground line cut off, make two tiers in the night colours. The stills are `recoloured-silhouettes.png` and `regenerated-silhouettes.png` in the same folder.
|
|
439
|
+
|
|
440
|
+
**Verdict.** A forced palette keeps a regenerated set consistent with itself at another time of day. It does not keep it consistent with the first time. The shapes change, and the night prompt adds a moon and stars to clean off. For a second time of day of the same place, recolour the finished set by luminance rank onto the new palette, leaving out the colours of lights. It is free, and the two times line up. Generate only what the new time adds, such as a moon, as its own sprite.
|
|
441
|
+
|
|
442
|
+
## 21. Key Retro Diffusion layers by script
|
|
443
|
+
|
|
444
|
+
**Question.** Step 15 found that Retro Diffusion's `tile_x` makes a seamless picture and its `remove_bg` breaks the seam (ratio 3.9 on the near layer). If a layer is generated with `tile_x` and no background removal, on a flat background, and keyed by script, does the seam survive? And is the result usable as a layer?
|
|
445
|
+
|
|
446
|
+
**Setup.** Step 15's volcanic far range and near ridges, at seed 4242 and 384×96, with `tileX: true` and `removeBg: false`. Each prompt is step 15's with "isolated on a plain flat chroma-key green background" added. Two styles: `rd_plus__environment`, as in step 15, and `rd_plus__default`, which step 19 found honours `tile_y`. The default style also got a row of volcanoes as a middle layer. 5 images through PixelKiln at $0.06 each, $0.30 in all. The manifest, lockfile, preview spec and build script are in [`benchmarks/parallax-rd-key`](../benchmarks/parallax-rd-key).
|
|
447
|
+
|
|
448
|
+
`parallax.py key` takes the most common colour on the top row as the background. It removes every pixel within 24 of it on each channel that connects to the top row through other such pixels. It works out the connection on three copies side by side, so both edges of a picture that wraps key alike. The seam ratio is step 1's, measured before and after keying.
|
|
449
|
+
|
|
450
|
+
**Result.**
|
|
451
|
+
|
|
452
|
+
| Style | Layer | Background drawn | Seam ratio as generated | Keyed | Share removed |
|
|
453
|
+
|---|---|---|---|---|---|
|
|
454
|
+
| Environment | Far range | A pale lilac sky | 0.4 | 0.3 | 28% |
|
|
455
|
+
| Environment | Near ridges | A near-black sky | 0.7 | 0.6 | 27% |
|
|
456
|
+
| Default | Far range | Flat pale mint | 1.1 | 1.4 | 45% |
|
|
457
|
+
| Default | Volcanoes | A teal to violet gradient | 0.5 | 0.4 | 46% |
|
|
458
|
+
| Default | Near ridges | Flat dark green | 1.4 | 1.3 | 51% |
|
|
459
|
+
|
|
460
|
+
- **The seam survives keying.** Every keyed layer joins with a ratio of 0.3 to 1.4, against 3.9 for step 15's near layer with Retro Diffusion's own background removal. A colour key decides pixel by pixel, so where the two edges of a seamless picture match, their alpha matches too. The left and right edges disagree on at most 1% of rows.
|
|
461
|
+
- **`rd_plus__default` honours `tile_x` too.** Its three pictures wrap with ratios of 0.5 to 1.4 as generated. With step 19, it honours both axes.
|
|
462
|
+
- **The environment style still draws whole scenes.** Neither of its pictures has the green background. The far range sits under a pale sky and the near ridges under a near-black one, much as in step 15 at the same seed. The pale sky keys out cleanly and leaves a usable stack of far ranges. The near ridges are as dark as their sky, so no threshold separates them. The key takes 16% of the picture at 8, 27% at 24 and 61% at 48, and at 24 it already cuts into the ridges.
|
|
463
|
+
- **The default style drew a flat background on two of three.** The near ridges came on one flat dark green and keyed out with no green pixel left on the layer. The far range came on a flat pale mint rather than green, which keys as well, and leaves a flat one-colour band like PixelLab's far ranges in step 18. The volcanoes came under a dusk gradient. The key takes the top band only and leaves violet bands behind the cones.
|
|
464
|
+
|
|
465
|
+

|
|
466
|
+
|
|
467
|
+

|
|
468
|
+
|
|
469
|
+
**Verdict.** Keep, with `rd_plus__default`. Generate with `tileX` and no background removal, ask for a plain flat background, and key it out by script, and the seam survives. Check each candidate for a flat background first, since one in three came with a gradient. The environment style is still a scene generator; its pale-sky far ranges key well and its dark layers do not. This is the one way in this note to get a transparent layer that loops sideways as generated, with no cut or crossfade, at $0.06 a layer. Its colours are Retro Diffusion's own, so keep the rest of the set on them, as step 19 found.
|
|
368
470
|
|
|
369
471
|
## A proposal for PixelKiln
|
|
370
472
|
|
|
371
|
-
Research only
|
|
473
|
+
Research only. Nothing here is built.
|
|
372
474
|
|
|
373
475
|
**A parallax set in the manifest.** A set names its layers in order, far to near, and what they share:
|
|
374
476
|
|
|
@@ -388,21 +490,21 @@ Research only; nothing here is built.
|
|
|
388
490
|
}
|
|
389
491
|
```
|
|
390
492
|
|
|
391
|
-
`speed` is the fraction of the camera's movement
|
|
493
|
+
`speed` is the fraction of the camera's movement. That is the convention of Tiled, Godot and Phaser, so it is what a person would type. `bottom` places a layer on a shared canvas. `haze` is step 9's push toward the sky colour, applied after generation with the palette held. The assets are ordinary manifest assets, so planning, budgets, the lockfile and review work as they do today. A silhouette set (step 12) would have the same shape, with runs instead of single layers.
|
|
392
494
|
|
|
393
495
|
**Export.**
|
|
394
496
|
|
|
395
|
-
- **Tiled** fits best
|
|
396
|
-
- **Godot
|
|
497
|
+
- **Tiled** fits best. Each parallax layer becomes an image layer, with `parallaxx` set to the speed and `repeatx` for a looping layer.
|
|
498
|
+
- **Godot** gets a `Parallax2D` per layer, with `scroll_scale` set to the speed and `repeat_size` to the width.
|
|
397
499
|
- **LDtk** has no image layer. Each layer would be a Tiles layer over a tileset cut from the layer's picture, with `parallaxFactorX` written as 1 − speed and `parallaxScaling: false` (step 11).
|
|
398
500
|
|
|
399
|
-
**A preview.** `parallax.py scroll` and `compose` already show a set moving. A `pixelkiln parallax preview` that writes the same
|
|
501
|
+
**A preview.** `parallax.py scroll` and `compose` already show a set moving. A `pixelkiln parallax preview` that writes the same animation would let a person judge a set before export.
|
|
400
502
|
|
|
401
503
|
## What other people are doing
|
|
402
504
|
|
|
403
|
-
- **Layered generation models.** [LayerDiffuse](https://arxiv.org/abs/2402.17113) (Apache-2.0) adds transparency to latent diffusion models and can generate several layers of one scene together. [Qwen-Image-Layered](https://github.com/QwenLM/Qwen-Image-Layered) (Apache-2.0, December 2025)
|
|
404
|
-
- **Seamless generation.** Circular padding in the convolutional layers makes a diffusion model's output wrap
|
|
405
|
-
- **Providers.** Retro Diffusion's API takes `tile_x` and `tile_y` booleans for seamless output and `remove_bg` for transparency ([api-examples](https://github.com/Retro-Diffusion/api-examples))
|
|
505
|
+
- **Layered generation models.** [LayerDiffuse](https://arxiv.org/abs/2402.17113) (Apache-2.0) adds transparency to latent diffusion models and can generate several layers of one scene together. [Qwen-Image-Layered](https://github.com/QwenLM/Qwen-Image-Layered) (Apache-2.0, December 2025) breaks a picture into a chosen number of RGBA layers, at 640 or 1024 px buckets. ComfyUI ships it with an fp8 variant because the default needs a lot of VRAM ([ComfyUI docs](https://docs.comfy.org/tutorials/image/qwen/qwen-image-layered)). Neither was trained on pixel art. Step 17 ran Qwen-Image-Layered on a 12 GB card. It works, slowly, and splits sky from scene rather than by distance. LayerDiffuse is untried.
|
|
506
|
+
- **Seamless generation.** Circular padding in the convolutional layers makes a diffusion model's output wrap, and ComfyUI has nodes for it, including X-only tiling ([ComfyUI-seamless-tiling](https://github.com/spinagon/ComfyUI-seamless-tiling)). It works on U-Net models such as SDXL. Reports say it does not work on transformer models; we have not checked. The other route is to shift the picture by half its width and inpaint the seam.
|
|
507
|
+
- **Providers.** Retro Diffusion's API takes `tile_x` and `tile_y` booleans for seamless output and `remove_bg` for transparency ([api-examples](https://github.com/Retro-Diffusion/api-examples)). PixelKiln already exposes them as `tileX` and `tileY` ([Retro Diffusion](./RETRO_DIFFUSION.md)). `rd_plus__environment` honours `tile_x` (step 15) and `rd_plus__default` honours both `tile_y` and `tile_x` (steps 19 and 21). We have not checked the other styles. We found no parallax or seamless option in PixelLab's v2 API. Pixflux offers a transparent background, a forced palette and an init image, up to 400×400 ([API](https://api.pixellab.ai/v2/llms.txt)). Scenario's tiling options are texture tools rather than scene tools ([help](https://help.scenario.com/articles/3312894507-scenario-texture-the-essentials)).
|
|
406
508
|
- **Classic hardware.** The Mega Drive has two scrolling planes with per-line scroll tables ([RasterScroll](https://rasterscroll.com/mdgraphics/graphical-effects/row-column-scrolling/)). Games such as *Thunder Force IV* fake many layers from them by scrolling groups of lines at different speeds.
|
|
407
509
|
|
|
408
510
|
## What has not worked
|
|
@@ -416,17 +518,24 @@ Research only; nothing here is built.
|
|
|
416
518
|
- Qwen-Image-Layered as a depth splitter (step 17).
|
|
417
519
|
- Describing a silhouette as distant or hazy in the prompt (step 18). Pixflux paints a scene around it.
|
|
418
520
|
- Tinting every tier toward one light haze colour (step 18). Depth reads backwards.
|
|
521
|
+
- Sideways strips for a climb (step 19). The far range's extension ends up filling half the view.
|
|
522
|
+
- Thin or flat clouds from pixflux (step 19). Four of four came back as a mound, a line, or a bank with a sun in it.
|
|
523
|
+
- Snapping a generated sky to a palette with few of its colours (step 19). It kept 5 of 47 and turned blotchy.
|
|
524
|
+
- Generating a set again for a second time of day (step 20). It stays on the palette, but every peak moves, and "at night" drew a moon or stars into 7 of 9 pictures.
|
|
525
|
+
- A palette swap onto a night palette's light colours (step 20). Pink-lit snow took the colours of the lit windows and turned orange.
|
|
526
|
+
- Keying a dark layer off a dark sky (step 21). Retro Diffusion's environment ridges are as dark as the sky it drew behind them.
|
|
419
527
|
|
|
420
528
|
## What is next
|
|
421
529
|
|
|
422
530
|
- **Build the proposal** above: the manifest shape, a preview, and Tiled, Godot and LDtk export. Open the LDtk result in the editor to check the factor's direction.
|
|
423
|
-
- **Check the finished sets in an engine.**
|
|
424
|
-
- **A
|
|
425
|
-
- **
|
|
531
|
+
- **Check the finished sets in an engine.** The previews in steps 18 and 19 come from the script. No set has been placed in Tiled, Godot or Phaser.
|
|
532
|
+
- **A palette swap in the engine.** Step 20's table could run as a lookup in a shader, so one set covers a day cycle with no extra pictures.
|
|
533
|
+
- **A time of day lit from another side**, such as midday. A palette swap cannot move the light, so this is where generating again might earn its cost.
|
|
534
|
+
- **A full sideways Retro Diffusion set** from `rd_plus__default`, keyed by script and scrolled, with retries for candidates that come on a gradient.
|
|
426
535
|
|
|
427
536
|
## Running the scripts
|
|
428
537
|
|
|
429
|
-
They need numpy, pillow and scipy
|
|
538
|
+
They need numpy, pillow and scipy. `depth.py` also needs torch and transformers.
|
|
430
539
|
|
|
431
540
|
```bash
|
|
432
541
|
# How badly each picture wraps.
|
|
@@ -466,7 +575,7 @@ python3 research/scripts/parallax.py compose <out.gif> 0.6,0.85,0.92 7 <silhouet
|
|
|
466
575
|
# Step 18. Numbers for choosing between candidates: how much touches each side, colours, the opaque box.
|
|
467
576
|
python3 research/scripts/parallax.py screen <png>...
|
|
468
577
|
|
|
469
|
-
# Trim a silhouette and dither its bottom 30% out.
|
|
578
|
+
# Trim a silhouette and dither its bottom 30% out. A fourth argument cuts that many rows off the bottom first.
|
|
470
579
|
python3 research/scripts/parallax.py foot <png> <out.png> 0.3
|
|
471
580
|
|
|
472
581
|
# Mix toward a colour and snap to the biome palette (a manifest's or a picture's).
|
|
@@ -480,4 +589,31 @@ STILL=<first-frame.png> SCALE=2 python3 research/scripts/parallax.py skyline <ou
|
|
|
480
589
|
|
|
481
590
|
# Everything for step 18 at once.
|
|
482
591
|
sh benchmarks/parallax-refined/build.sh
|
|
592
|
+
|
|
593
|
+
# Step 19. Stack a cliff into a wall 700 rows tall, keeping its top 100 rows as the summit.
|
|
594
|
+
python3 research/scripts/parallax.py wall <cliff.png> <out.png> 700 100
|
|
595
|
+
|
|
596
|
+
# Vertical preview: the camera climbs through the layers and back; .webp or .gif.
|
|
597
|
+
STILL=<strip.png> SCALE=2 python3 research/scripts/parallax.py climb <out.webp> <spec.json>
|
|
598
|
+
|
|
599
|
+
# Everything for step 19 at once.
|
|
600
|
+
sh benchmarks/parallax-vertical/build.sh
|
|
601
|
+
|
|
602
|
+
# Step 20. Swap palettes by luminance rank; cool leaves out target colours whose red is above their blue.
|
|
603
|
+
python3 research/scripts/parallax.py recolour <png> <out.png> <dusk.json> <night.json> cool
|
|
604
|
+
|
|
605
|
+
# Keep the largest shape and whatever touches the bottom row, then trim empty rows. Drops a moon and stars.
|
|
606
|
+
python3 research/scripts/parallax.py isolate <png> <out.png>
|
|
607
|
+
|
|
608
|
+
# Everything for step 20 at once, after step 18's build.
|
|
609
|
+
sh benchmarks/parallax-night/build.sh
|
|
610
|
+
|
|
611
|
+
# Step 21. Key out the top row's colour within 24, flooding from the top with the picture wrapped sideways.
|
|
612
|
+
python3 research/scripts/parallax.py key <png> <out.png> 24
|
|
613
|
+
|
|
614
|
+
# The picture twice side by side, so its seam is in the middle.
|
|
615
|
+
python3 research/scripts/parallax.py twice <png> <out.png>
|
|
616
|
+
|
|
617
|
+
# Everything for step 21 at once.
|
|
618
|
+
sh benchmarks/parallax-rd-key/build.sh
|
|
483
619
|
```
|
package/package.json
CHANGED
|
@@ -157,8 +157,9 @@ Read only the reference needed for the current decision:
|
|
|
157
157
|
read [references/tiles.md](references/tiles.md). It covers which generator
|
|
158
158
|
to pick, how sets connect, every export format and what it refuses, and
|
|
159
159
|
what has and has not been checked in an engine.
|
|
160
|
-
- For a scrolling background in layers, looping a background sideways
|
|
161
|
-
|
|
160
|
+
- For a scrolling background in layers, looping a background sideways or
|
|
161
|
+
vertically, a climbing level's background, or parallax settings for Tiled,
|
|
162
|
+
Godot, Phaser or LDtk, read
|
|
162
163
|
[references/parallax.md](references/parallax.md).
|
|
163
164
|
- For Retro Diffusion styles, USD budgets, environment assets, animation, or
|
|
164
165
|
experimental limits, read
|
|
@@ -8,9 +8,9 @@ and numbers, at https://pixelkiln.griffen.codes/docs/research-parallax.
|
|
|
8
8
|
## The route to try first
|
|
9
9
|
|
|
10
10
|
Compose each layer in the engine from separate silhouettes rather than cutting
|
|
11
|
-
layers out of one scene. Generate a few
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
layers out of one scene. Generate a few landforms per biome, one at a time,
|
|
12
|
+
each prompted as a lone sprite (see "Generating silhouettes" below), and dither
|
|
13
|
+
the foot out afterwards. In the game, lay them in overlapping
|
|
14
14
|
runs (each next one about 72% of the way across the last, random flips, never
|
|
15
15
|
the same twice in a row, a few pixels of jitter), in two tiers tinted toward a
|
|
16
16
|
dusk or haze colour, over a sky the engine draws. Nothing hidden has to be
|
|
@@ -53,10 +53,46 @@ this; its numbers are in step 12 of the research note.
|
|
|
53
53
|
- Retro Diffusion's `rd_plus__environment` draws a whole scene whatever the
|
|
54
54
|
prompt says, so it is not a layer generator. Its `tileX` does wrap the
|
|
55
55
|
drawing, but `removeBg` breaks the seam it made.
|
|
56
|
+
- For a Retro Diffusion layer that loops sideways, use `rd_plus__default` with
|
|
57
|
+
`tileX`, `removeBg: false` and "a plain flat chroma-key green background" in
|
|
58
|
+
the prompt, then key the background out by script (`parallax.py key`). The
|
|
59
|
+
seam survives (ratios 0.3 to 1.4, against 3.9 with `removeBg`). It drew a
|
|
60
|
+
flat background on 2 of 3 tries, so check before keying.
|
|
61
|
+
|
|
62
|
+
## A second time of day
|
|
63
|
+
|
|
64
|
+
- Recolour the finished set onto the new time's palette by luminance rank
|
|
65
|
+
(`parallax.py recolour ... cool`) instead of generating it again. It is free,
|
|
66
|
+
and every shape stays where it was, so the two times line up.
|
|
67
|
+
- Take the new palette from the same prompt and seed as the first one, with the
|
|
68
|
+
time of day changed. For night, leave its warm light colours (windows, lamps,
|
|
69
|
+
the moon) out of the swap, or pink-lit snow turns orange.
|
|
70
|
+
- Generating again on the new palette keeps the layers consistent with each
|
|
71
|
+
other but moves every peak, and "at night" brought a moon or stars into 7 of
|
|
72
|
+
9 pictures, two of them despite "no moon, no stars" in the prompt.
|
|
56
73
|
- Pixel-art background removal is all or nothing per pixel: a silhouette asked
|
|
57
74
|
to fade at its foot comes back with a hard base. Plan a dithered fade, a
|
|
58
75
|
ground strip or a treeline in front.
|
|
59
76
|
|
|
77
|
+
## Scrolling vertically
|
|
78
|
+
|
|
79
|
+
- A climb needs tall layers or things placed at height: a tall landmark,
|
|
80
|
+
clouds scattered up the climb, a wall. 400×100 strips run out within a
|
|
81
|
+
quarter of a climb.
|
|
82
|
+
- Draw every layer the view's height plus climb × its vertical speed tall, and
|
|
83
|
+
place the layers for the lowest view so a climb never uncovers their feet.
|
|
84
|
+
- Scroll the sky's bands vertically (about 0.3) if it should change with
|
|
85
|
+
height; at speed 0 it never does.
|
|
86
|
+
- Clouds: prompt puffy cumulus as a lone sprite. Thin streaks and flat banks
|
|
87
|
+
fail in pixflux.
|
|
88
|
+
- A wall: pixflux draws a cliff as a pillar with a summit. Keep the summit and
|
|
89
|
+
repeat the body (`parallax.py wall`).
|
|
90
|
+
- An endless vertical loop: Retro Diffusion `tileY` on `rd_plus__default`, no
|
|
91
|
+
background removal. Keep the rest of the set on that picture's colours.
|
|
92
|
+
- Engines take the y of the same setting: Tiled `parallaxy`, Godot
|
|
93
|
+
`scroll_scale.y`, Phaser `setScrollFactor(x, y)`, LDtk `parallaxFactorY` as
|
|
94
|
+
1 − speed.
|
|
95
|
+
|
|
60
96
|
## Before generating
|
|
61
97
|
|
|
62
98
|
- A parallax background is several layers, not one scene. A single scenic
|