Bring your 2D worlds to life with real, physically-simulated water that flows, splashes, and interacts with your game objects. Not a visual trick: actual fluid dynamics, running entirely on the GPU.2D Water Simulation - GPU Particle FluidBring your 2D worlds to life with real, physically-simulated water that flows, splashes, and interacts with your game — not a visual trick, not a spring mesh, not a sprite animation. Actual fluid dynamics, running entirely on the GPU.WHY THIS IS DIFFERENTTraditional 2D water in Unity fakes it. SpriteShapes with wobbly surface points, sine-wave shaders, trigger zones that pretend to be liquid — they look okay from a distance, but they fall apart the moment you need water to actually behave like water.This package simulates thousands of fluid particles in real time. Water fills containers, flows through gaps, pours from faucets, splashes against walls, and pushes objects around. Objects push it back. It's not an illusion — it's a simulation, and it looks and feels like the real thing.KEY FEATURESREAL FLUID PHYSICSWater flows, pools, splashes, and settles naturally using a double-density relaxation solver. Viscosity, pressure, and surface tension all work together to produce convincing liquid behavior — from fast-moving streams to calm pools.GPU-POWERED PERFORMANCEThe entire simulation runs on the GPU via compute shaders. Spatial hashing, density calculations, pressure solving, collision detection — all computed in parallel. Supports thousands of particles with minimal CPU overhead. Scale quality to match your target platform, from mobile to desktop.TWO-WAY OBJECT INTERACTIONObjects float on the water with realistic buoyancy — they bob, tilt, and drift with the current. Moving objects displace water as they pass through it. Splash VFX events fire when objects enter or exit the surface. Everything is physically connected.COLLISION WITH COMPLEX SHAPESWater collides with BoxCollider2D, CircleCollider2D, and PolygonCollider2D. Colliders are rendered into a signed distance field (SDF) using the Jump Flood Algorithm, giving you smooth, accurate particle-surface interactions. Supports moving and rotating platforms with configurable update rates.FOAM & SURFACE DETAILA foam system tracks turbulent, fast-moving water and renders it with a distinct color and intensity. Foam builds up naturally in churning areas and fades over time — no manual placement needed.EMITTERS & WATER SOURCESCreate faucets, waterfalls, rain, fountains, or any custom water source. Emitters support continuous flow, burst spawning, directional velocity with randomness, and runtime control. A built-in respawn/drain system recycles particles for infinite loops.BEAUTIFUL & CUSTOMIZABLE RENDERINGA two-pass metaball renderer produces smooth, blobby liquid surfaces with distinct edge highlighting. Customize water color, edge color, thickness, surface threshold, and smoothness. Add velocity-based tinting for fast-moving water.Can be made to look and feel like water, lava, slime etc.EASY TO SET UP1. GameObject > Water > Create Water Simulation2. Add an emitter or spawn particles from code3. DoneA ScriptableObject holds all settings — drag sliders in the Inspector to tune the look and feel. Over 40 parameters, all with tooltips, sensible defaults, and real-time preview.BUILT FOR 2D GAMESWhether you're making a platformer with water hazards, a physics sandbox, a puzzle game with flowing liquids, a fishing game etc — this is the water system you've been looking for. It integrates cleanly with Unity's 2D physics, sorting layers, and URP rendering pipeline.It is not well suited for infinite side scrollers, as the simulation is contained within bounds, or games that need reflections on the water surface.WHAT'S INCLUDED- Full GPU simulation with compute shaders- SDF-based collision system (Box, Circle, Polygon colliders)- Buoyancy system with probe-based submersion detection- Emitter system with continuous, burst, and runtime spawning- Foam tracking and rendering- Splash VFX event callbacks- Two-pass metaball rendering with customizable shaders- Debug visualization tools (particles, velocity, SDF, spatial hash)- One-click setup menu items- Complete documentation- Demo scenes- Clean, namespaced C# codebase (Water assembly)REQUIREMENTS- GPU with compute shader support (most GPUs do these days, but WebGL doesn't, so no browser builds).TECHNICAL SPECS- Easily supports 10k+ particles, but it's fully configurable anyway, you don't need as many for lots of use cases.- 1-8 substeps per frame- SDF resolution: 64-512px- Render resolution: 256-1024px- Cross-platform: DirectX, Metal, Vulkan, OpenGL ES 3.0+- Minimal CPU overhead — simulation runs entirely on the GPU- Full C# API for runtime controlThis package was developed with the help of AI tooling (Claude). While the core architecture, algorithm implementation (from https://www.ljll.fr/~frey/papers/levelsets/Clavet%20S.,%20Particle-based%20viscoelastic%20fluid%20simulation.pdf) were written by me, and design decisions, and creative direction are mine, AI proved invaluable for accelerating development in several areas. In particular in optimizing the GPU pipeline. It helped implement the counting sort spatial hashing algorithm, reduce CPU-GPU synchronization points, and polish the codebase for consistency and robustness. It was also very helpful in documentating the code to help the end-user purchasing this package navigate it and understand it.




