Skip to content

Make flask resizable and keep water fill proportional#52

Merged
Testtesttestestes merged 1 commit into
mainfrom
codex/make-flask-resizable-with-dynamic-filling
Mar 10, 2026
Merged

Make flask resizable and keep water fill proportional#52
Testtesttestestes merged 1 commit into
mainfrom
codex/make-flask-resizable-with-dynamic-filling

Conversation

@Testtesttestestes

Copy link
Copy Markdown
Owner

Motivation

  • Allow the flask (container) to be resized at runtime so its width/height can be adjusted and the liquid adapts visually and physically.
  • Keep the percentage-based fill behavior so changing the flask size preserves the desired water level expressed by progress.

Description

  • Added UI sliders Flask Width and Flask Height and forwarded them into RealisticProgressBar as flaskWidth/flaskHeight props so the shape can be changed at runtime.
  • Made the component compute flaskHalfSize and flaskRadius, used when generating initial particle positions and when reinitializing the SPH simulation.
  • Added _flaskShape state and setFlaskShape API in src/sph/sph.js and threaded u_flask_half_size / u_flask_radius uniforms into the particle update and pressure passes.
  • Updated marching-squares renderer (src/sph/renderer.js / src/sph/ms.frag) to accept the dynamic flask shape and use it for rendering/refraction, and updated update.frag/pressure.frag to use the uniforms for collision, density and respawn logic so active particle count (controlled by u_progress) still represents the fill percentage.

Testing

  • Ran a production build with npm run build which completed successfully.
  • Started the dev server and captured a visual regression screenshot via an automated Playwright script which produced artifacts/flask-resizable.png (first attempt timed out, second run succeeded).
  • Committed the changes and created the PR after the build and validation artifacts were generated.

Codex Task

@Testtesttestestes Testtesttestestes merged commit a158448 into main Mar 10, 2026
1 check passed
@Testtesttestestes Testtesttestestes deleted the codex/make-flask-resizable-with-dynamic-filling branch March 10, 2026 11:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant