oneshotlm
Compare all models on this prompt →

Fluid simulation · glm-5

Create a real-time fluid simulation on a full-screen canvas where dragging the mouse pushes swirling colored dye through the fluid.

⛨ sandboxed Open in new tab ↗
transcript · 4 messages
user

Create a real-time fluid simulation on a full-screen canvas where dragging the mouse pushes swirling colored dye through the fluid.

assistant
thinking
The user wants a real-time fluid simulation on a full-screen canvas with mouse interaction that pushes colored dye through the fluid. This is a classic fluid dynamics simulation, typically based on Jos Stam's "Real-Time Fluid Dynamics for Games" paper or similar approaches.

I'll create a fluid simulation that:
1. Uses a full-screen canvas
2. Implements a Navier-Stokes based fluid simulation (simplified)
3. Allows mouse dragging to add velocity and colored dye
4. Creates swirling, colorful effects

Key components:
- Velocity field (u, v components)
- Density/dye field (with color)
- Advection, diffusion, and projection steps
- Mouse interaction to add forces and dye

Let me write a complete self-contained HTML file with the simulation.
write /workspace/index.html (26296 bytes)
toolResult

Successfully wrote 26296 bytes to /workspace/index.html

assistant
thinking
I've created a real-time fluid simulation with WebGL. Let me verify the file was created correctly.

I've created a full real-time fluid simulation with the following features: **Fluid Simulation Features:** - **WebGL-accelerated** - Uses GPU shaders for smooth real-time performance - **Navier-Stokes based** - Implements advection, divergence, pressure solving, and vorticity confinement - **Full-screen canvas** - Responsive to any window size **Interactive Dye System:** - **Mouse drag** pushes fluid and adds swirling colored dye - **Touch support** for mobile devices - **Random color generation** using HSL color space for vibrant, varied colors - **Auto-splats** - Ambient movement keeps the simulation interesting even without input **Visual Effects:** - Color dissipation for gradual fading - Vorticity confinement to maintain swirling motion - Enhanced color contrast with gamma correction - Multiple initial splats to start with an interesting pattern The simulation uses: - 256x256 resolution for the velocity field - 512x512 resolution for the dye/color field - 20 pressure iterations for stable fluid behavior - Curl-based vorticity to create those satisfying swirl patterns Just drag your mouse across the canvas to push the fluid and add colorful dye trails!

TAKE IT TO CODE

A single self-contained HTML file — copy it and open in any browser, or reuse the prompt with your own pi-agent run.

RUN

modelglm-5
vendorZ.ai · GLM
harnesspi-agent
generated2026-07-22

EVALUATION

4/5 working

Fluid dye simulation with colorful swirling smoke that reacts to click and drag with new dye and motion.

Vision grade · anthropic/claude-sonnet-5

MEASUREMENTS

Raw readings from the capture, not a verdict — the grade above is the only judgement. Percentages are how much of the screen changed; the measure under-reports sparse motion on a dark background.

idle motion9.2%
on click6.0%
on drag17.8%
on wheel10.1%
on enter + space7.5%
on arrow keys7.0%
on w/a/s/d7.0%
frame spread28.6 / 255
console errors0
js errors none

METRICS

runtime91.9s
tokens in6.5k
tokens out6.7k
cached2.9k
cost / run$0.0170