Skip to content

Fix rendering bugs that make some scenes look wrong - #12

Merged
beingsuz merged 3 commits into
mainfrom
claude/project-thread-tyokzj
Sep 26, 2026
Merged

beingsuz merged 3 commits into
mainfrom
claude/project-thread-tyokzj

Conversation

@beingsuz

Copy link
Copy Markdown
Collaborator

Requested by beingsuz · project thread

Before: twinkling particles (stars, fireflies) faded to nothing within about two seconds. On a 16:10 or 4:3 screen the default fit showed more than the scene and smeared its top and bottom rows; on a square screen it stretched the picture. Children of rotated layers were placed on the wrong side. Particle systems ignored their parent layers, scripts and timelines. A layer whose last effect failed to build could draw as an opaque box.

After: those scenes draw the way Wallpaper Engine draws them, as far as the code can be checked without real wallpapers (see Verification).

This is the first batch from an audit of the renderer; more fixes follow on this branch once example wallpapers arrive.

Changes

Particles

  • oscillatealpha / oscillatesize multiplied the current value every frame and nothing reset it: alpha went from 1 to 0.0002 in 120 frames. Colour, alpha and size are now rebuilt from the spawn values each frame, and every operator scales what the earlier ones left (so alphafade + alphachange both apply instead of the last one winning).
  • colorchange honours starttime / endtime.
  • Particle systems are placed through world_xf, so they follow parents, puppet attachments, script moves and timelines (retransform_dirty now covers them).
  • A particle system hidden at load is still built, so a script can show it later.

Layout

  • --scaling default covers the screen like fill, cropping the overhang, instead of overscanning narrower screens and stretching square ones.
  • world_xf rotated a child's offset by +angle, while every quad rotates by -angle. Children of rotated parents were mirrored around them.
  • auto_projection doubled the extent: origins are measured from the corner, not the centre.
  • The cursor is mapped through the scaling window (crop, focus, zoom), so cursor effects react under the real cursor. Parallax y was inverted relative to x.

Effects

  • When the planned last pass is dropped, the pass that reaches the scene is rebuilt with the layer's blend instead of its effect's normal (One/Zero).
  • g_Daytime is the time of day instead of 0.
  • uniform int members (detected from naga's member type) are written as i32, not as float bits.

Verification

  • cargo fmt --check, cargo clippy --workspace --all-targets -D warnings and cargo test --workspace pass on Linux with lavapipe.
  • New tests: oscillate no longer compounds and two alpha operators multiply (both fail on main), default fit never reaches past the content, child rotation matches the parent quad, auto projection size, cursor through the crop window, particle world transform, int uniform bytes.
  • Not tested: any real Wallpaper Engine scene, and Windows. The container has no WE assets. The parallax direction and the auto projection meaning are inferred from kirie's own conventions, not checked against Wallpaper Engine.

🤖 Generated with Claude Code

https://claude.ai/code/session_01ASKszRoN1cM2ks8vnFvkiy


Generated by Claude Code

oscillatealpha and oscillatesize multiplied the particle's current value
every frame and nothing reset it, so a twinkle between 50% and 100% was
at 0.0002 after two seconds: twinkling stars and fireflies faded out.
alphafade, alphachange, sizechange and colorchange instead overwrote the
value from the spawn value, so only the last of them counted.

Colour, alpha and size are now rebuilt from the spawn values every frame
and each operator scales what the ones before it left. colorchange also
reads its starttime and endtime like the other change operators.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ASKszRoN1cM2ks8vnFvkiy
The default scaling mode cropped only when the screen was wider than the
scene. On a narrower one (16:10, 4:3) it showed more than the scene and
stretched its edge rows into bands, and on a square screen it stretched
the whole picture. Wallpaper Engine scales to cover and crops the
overhang, which is what fill already did; default now does the same.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ASKszRoN1cM2ks8vnFvkiy
- A child of a rotated parent was turned the opposite way around it:
  world_xf rotated by +angle while every quad rotates by -angle.
- The auto projection doubled the scene size, treating origins as
  centred when they are measured from the bottom-left corner, so a full
  background filled a quarter of the screen.
- The cursor is mapped through the scaling window, so cursor effects on
  a cropped or zoomed scene react under the real cursor. Parallax moves
  the same way on both axes (y was inverted against x).
- Particle systems now follow their parents, puppet attachments, scripts
  and timelines, and a system hidden at load can be shown later.
- When a layer's last effect pass is dropped (shader missing or failing
  to build), the pass that reaches the scene gets the layer's blend
  instead of its effect's 'normal', which drew an opaque box.
- g_Daytime carries the time of day instead of 0.
- A 'uniform int' parameter is written as an i32, not float bits.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ASKszRoN1cM2ks8vnFvkiy
@beingsuz beingsuz self-assigned this Sep 26, 2026
@coderabbitai

coderabbitai Bot commented Sep 26, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 9879c497-ca1b-4193-91bf-3b4cb7fb323b

📥 Commits

Reviewing files that changed from the base of the PR and between 0a55364 and b77dc34.

📒 Files selected for processing (9)
  • crates/kirie-render/src/particle/operator.rs
  • crates/kirie-render/src/particle/system.rs
  • crates/kirie-render/src/scaling.rs
  • crates/kirie-render/src/scene/extras.rs
  • crates/kirie-render/src/scene/model.rs
  • crates/kirie-render/src/scene/pipeline.rs
  • crates/kirie-render/src/scene/renderer.rs
  • crates/kirie-render/src/scene/uniforms.rs
  • crates/kirie-render/tests/particle.rs
 __________________________________________________
< Your stack overflowed; I brought a bigger stack. >
 --------------------------------------------------
  \
   \   \
        \ /\
        ( )
      .( o ).
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@beingsuz
beingsuz marked this pull request as ready for review September 26, 2026 22:19
@beingsuz
beingsuz merged commit 56d621a into main Sep 26, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants