Skip to content

Vengiro/Fluid-simulation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

14 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Fluid Simulation

This project is a GPU-accelerated 2D fluid simulation built in Unity using a hybrid of Smoothed Particle Hydrodynamics (SPH) and Eulerian grid-based methods. It leverages C# scripts and HLSL compute shaders to achieve real-time, interactive fluid behavior.

๐ŸŽฎ Features

  • ๐Ÿ’ง Hybrid Fluid Simulation

    • SPH for particle-based dynamics and surface detail
    • Eulerian grids for stable pressure projection and boundary handling
  • โšก Real-Time Performance

    • GPU-parallelized via HLSL compute shaders
    • Efficient particle neighbor search and pressure solver
    • Optimized for interactive use in Unity scenes
  • ๐ŸŽฅ Interactive Visualization

    • Real-time visual feedback in Unity Editor
    • Adjustable parameters for simulation behavior
    • Supports basic UI input for experiments and tuning

๐Ÿ“ธ Demo

(Insert GIF or screenshot here when I get time)

๐Ÿงช How It Works

SPH (Smoothed Particle Hydrodynamics)

  • Particles represent fluid parcels
  • Density and pressure calculated using smoothing kernels
  • Forces: pressure, viscosity, external (e.g., gravity)

Eulerian Grid

  • Pressure projection step solved on a 2D grid to enforce incompressibility
  • Combines well with SPH for stability and boundary handling

GPU Acceleration

  • All major computation steps run in parallel using HLSL compute shaders
  • Optimized buffer management and thread grouping for speed

๐Ÿ› ๏ธ Technologies

  • Unity (URP compatible)
  • C# (simulation logic, data orchestration)
  • HLSL (compute shaders for physics)
  • Unity Compute Buffers & Shader Dispatching

๐Ÿš€ Getting Started

  1. Clone the repo:
git clone https://github.com/Vengiro/Fluid-simulation.git

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published