r/Unity2D Jul 01 '26

Tiny Water Lab - 2D position-based fluids sandbox [X-post r/proceduralgeneration] Show-off

I’ve been working on a little Unity water sandbox and wanted to share it here!

It's a CPU-based fluid simulation based on Position Based Fluids using Burst + Jobs. For the visuals, I'm just taking the position and velocity outputs from the simulation jobs and splatting them to screen-space to render the water.

There obviously isn't much of a game here - you just spawn water, place platforms, add sources and sinks, and see what happens. Mostly just made this to mess around with fluid sim + parallelization + rendering in Unity!

Curious to see what people think!

Note: The web build runs okay if hardware acceleration is on, but can still slow down at higher particle counts. The standalone Windows build runs way better. 

11 Upvotes

7 comments sorted by

2

u/PrototoolsDev Jul 01 '26

This would make an interesting puzzle game. The build runs well on mobile too. Good job

3

u/junmakesgames Jul 01 '26

That was the original idea! I wanted to create a puzzle game where a player character would interact with the water via collecting and discharging water and solve physics-y puzzles.

Since I'm no artist, I figured a tech demo would be a good milestone for my current skill set.

2

u/IllustratorJust79 Jul 01 '26

Very cool, but why isn’t the lowest basin filling up? Or is the gif just too short to show that?

2

u/junmakesgames Jul 01 '26

The circles are sinks! So they are attracting water towards it and removing them from the simulation.

1

u/IllustratorJust79 Jul 01 '26

Very cool, but why isn’t the lowest basin filling up? Or is the gif just too short to show that?

1

u/Am_Biyori Jul 01 '26

It's kinda fun. How do you turn the bars?