Skip to content

[2/3] feat: add the foreground blur, falling leaves and water reflection - #119

Merged
arudaev merged 1 commit into
mainfrom
feature/36-atmosphere
Oct 23, 2026
Merged

arudaev merged 1 commit into
mainfrom
feature/36-atmosphere

Conversation

@arudaev

@arudaev arudaev commented Oct 23, 2026 •

Copy link
Copy Markdown
Member

What and why

The atmosphere layers from docs/04 (layers 4, 7 and 8), as three helpers for any stage chunk:

  • Foreground blur – blurForeground(layer): a WebGL blur on the scroll 1.15–1.2 layer (no-op on Canvas).
  • Falling leaves – addLeaves(scene, state): autumn leaves at foreground parallax; they fall and drift left when clean and rise in the anomaly state. The view starts already full of leaves.
  • Water reflection – addReflection(water, layers): finds the waterline from the water layer's alpha, mirrors the given layers about it once into a texture, masks it to the water and ripples it in 4 px strips.

Only the ripple strips and the leaves move per frame; the mirror and the blur are built once. The geometry (waterline, mirror placement, ripple, leaf drift) is pure and tested in fx/atmosphereLayout.ts.

Test chunk: in dev builds, F10 (from the HUD) opens AtmosphereTest, the whole first Rusty Creek chunk: V toggles the atmosphere, A switches clean / anomaly leaves, arrows pan, Esc closes. Dev-only, like the #37 test chunk.

Note: the creek art already has reflections painted into the water, so the game's reflection is subtle there (alpha 0.4); it will matter more on the Hidden Garden pond.

Verification

  • npm run typecheck, npm test (22 passing, 4 new), npm run build; production bundle has neither test scene.
  • Dev server, side by side with V: foliage blurred, leaves falling (A: rising), mirrored concrete in the water; no console errors.
  • 60 fps not measured: the browser pane was hidden (throttled) during the check. Needs one look on a laptop.

Issue

Closes #36 (stacked PR – linked by hand under Development).

Stack

Merge bottom up.

The foliage layer gets a WebGL blur; leaves drift at foreground parallax, falling when clean and rising in the anomaly state; the water mirrors layers 1-6 about its waterline, drawn once into a texture and rippled in strips. Dev builds open a test chunk with F10.
@arudaev arudaev self-assigned this Oct 23, 2026
@vercel

vercel Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
wincs Ready Ready Preview Oct 23, 2026 9:27pm UTC

Request Review

@github-actions github-actions Bot added the area:ui HUD, crash window, title, menus label Oct 23, 2026
@arudaev arudaev linked an issue Oct 23, 2026 that may be closed by this pull request
3 tasks
@arudaev arudaev changed the title [2/2] feat: add the foreground blur, falling leaves and water reflection [2/3] feat: add the foreground blur, falling leaves and water reflection Oct 23, 2026
@arudaev
arudaev marked this pull request as ready for review October 23, 2026 21:38
@arudaev
arudaev changed the base branch from feature/37-anomaly-fx to main October 23, 2026 21:45
@arudaev
arudaev merged commit 6fd56fb into main Oct 23, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:ui HUD, crash window, title, menus

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[M5-S4] Foreground blur, falling leaves and water reflections

1 participant