{"id":21611783,"url":"https://github.com/qervas/water_simulation","last_synced_at":"2026-05-16T23:15:51.384Z","repository":{"id":200147750,"uuid":"703195389","full_name":"Qervas/water_simulation","owner":"Qervas","description":"Bachelor thesis project: SPH water simulation and OpenGL rendering","archived":false,"fork":false,"pushed_at":"2026-05-01T13:17:05.000Z","size":65314,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-05-01T15:18:21.807Z","etag":null,"topics":["opengl","sph"],"latest_commit_sha":null,"homepage":"","language":"Cuda","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Qervas.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-10-10T19:19:41.000Z","updated_at":"2026-05-01T13:17:13.000Z","dependencies_parsed_at":null,"dependency_job_id":"0a45a537-3faa-4228-afda-f39ea4146d10","html_url":"https://github.com/Qervas/water_simulation","commit_stats":null,"previous_names":["qervas/water_simulation"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Qervas/water_simulation","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Qervas%2Fwater_simulation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Qervas%2Fwater_simulation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Qervas%2Fwater_simulation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Qervas%2Fwater_simulation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Qervas","download_url":"https://codeload.github.com/Qervas/water_simulation/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Qervas%2Fwater_simulation/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33121894,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-16T18:38:32.183Z","status":"ssl_error","status_checked_at":"2026-05-16T18:38:29.903Z","response_time":115,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["opengl","sph"],"created_at":"2024-11-24T21:13:51.438Z","updated_at":"2026-05-16T23:15:51.379Z","avatar_url":"https://github.com/Qervas.png","language":"Cuda","funding_links":[],"categories":[],"sub_categories":[],"readme":"# water_sim\n\nGPU-native water simulation and offline cinematic renderer.\nModern rebuild of a 2023 bachelor project.\n\n## Status\n\n- ✅ **Phase 1 (Foundation)** — modern toolchain wired (CUDA 13.2 + Vulkan 1.4 + Slang + LBVH + JSON scene loader + test harness)\n- ✅ **Phase 2 (DFSPH solver)** + **Phase 2.5 (boundaries + viscosity + convergence)** — DFSPH with Akinci 2012 boundary particles, XSPH viscosity, CUB-based density-solver convergence, and explicit damping. Settled-puddle regression test green.\n- ✅ **Cycles render pipeline** (Blender) — photoreal path-traced glass-tank scene via `tools/blender_render.py`. Reads sim binary frames → metaball fluid surface → renders with proper Z-up convention, glass tank visible at sim domain bounds, wood counter, soft three-point lighting.\n- ⏳ **Phase 3** (in-engine screen-space viewport) — not started\n- ⏳ **Phase 4** (anisotropic surface reconstruction in CUDA) — not started\n- ⏳ **Phase 5** (Vulkan-RT path tracer) — not started; rendering currently bridged via Blender Cycles\n- ⏳ **Phase 6** (OIDN denoise + ffmpeg cinematic mux) — partially via ffmpeg; no in-renderer denoise\n\nSee [`docs/superpowers/specs/2026-04-23-water-simulation-rebuild-design.md`](docs/superpowers/specs/2026-04-23-water-simulation-rebuild-design.md) for the full design and [`docs/superpowers/plans/`](docs/superpowers/plans/) for per-phase implementation plans.\n\n## What works end-to-end (today)\n\n```bash\n# Simulate\n./build/linux-debug-local/bin/sim_cli \\\n    --scene scenes/dam_break.json --frames 0:90 \\\n    --record --no-vulkan --out out/dam_break\n\n# Render with Cycles (glass-tank scene)\nblender --background --python tools/blender_render.py -- \\\n    --seq out/dam_break --out-dir out/dam_break_render \\\n    --stride 2 --spp 64 --res 1280 720\n\n# Mux to mp4\nffmpeg -y -framerate 15 -pattern_type glob \\\n    -i 'out/dam_break_render/render_*.png' \\\n    -c:v libx264 -pix_fmt yuv420p -crf 18 out/dam_break.mp4\n```\n\nProduces a photoreal animation of a glass column collapsing inside a glass tank on a wood counter, with proper splash dynamics, refraction, and settling.\n\n## Tests\n\n26 unit tests + 2 regression tests, all green:\n- `water_tests` — kernels, particle store, cell grid, LBVH, scene loader, boundary sampler, DFSPH density/α/gravity\n- `water_regression` — diagnostic (single-particle gravity + boundary mass) + settled puddle (4913-particle block falls into 1m³ box, settles into stable puddle in \u003c1.5s sim time, no NaN, no escapees)\n\n## Tech stack\n\nCUDA 13.2 · Vulkan 1.4 + ray tracing extensions · Slang shaders → SPIR-V · CMake 3.27 · C++20 · CCCL (Thrust + CUB + libcu++) · doctest · nlohmann/json.\n\nNo OpenGL anywhere.\n\n## Hardware target\n\nPrimary: **NVIDIA RTX 5070 Mobile** (Blackwell, sm_120, 8 GB VRAM). Should also work on any RTX with VK_KHR_ray_tracing support; override `CMAKE_CUDA_ARCHITECTURES` for non-Blackwell GPUs.\n\n## Building\n\n### Prerequisites\n- CUDA Toolkit 13.x\n- Vulkan SDK 1.4 (LunarG; on Fedora `sudo dnf install vulkan-devel vulkan-tools vulkan-validation-layers-devel`)\n- `slangc` 2026.x on PATH (download from [shader-slang releases](https://github.com/shader-slang/slang/releases))\n- gcc ≤ 15 *or* clang as the CUDA host compiler (CUDA 13.2 doesn't support gcc 16; on Fedora 44 with gcc 16, use a conda gcc-14 toolchain — see `CMakeUserPresets.json` template).\n- CMake 3.27+ and Ninja\n\n### Build \u0026 test\n```bash\n# If you needed to override the CUDA host compiler, copy the template:\n#   (see \"CMakeUserPresets.json\" in repo root for an example — gitignored)\n\ncmake --preset linux-debug                 # or linux-debug-local if using user preset\ncmake --build build/linux-debug -j\nctest --preset linux-debug\n./build/linux-debug/bin/sim_cli --scene scenes/single_drop.json\n```\n\nExpected smoke-test output:\n```\n=== water_sim sim_cli ===\nscene:        single_drop\noutput:       320x240 @ 24.0 fps, frames 0..4\nsolver:       dfsph\nparticle r:   0.0100 m\nrest density: 1000.0 kg/m^3\nvulkan:       NVIDIA GeForce RTX 5070 Laptop GPU (api 1.4.x, RT yes)\nparticles:    180 (initial block)\nlbvh leaves:  180\nfirst dt:     0.004000 s (CFL with v=1 m/s)\n=== sim_cli OK ===\n```\n\n## Repository layout\n\n```\nwater_simulation/\n├── core/      # CUDA particle store, LBVH, boundary, timestepper\n├── scene/     # JSON scene loader\n├── renderer/  # Vulkan 1.4 device + Slang shader build pipeline\n├── apps/      # sim_cli (Phase 1) + viewport (Phase 3) entry points\n├── tests/     # doctest unit tests\n├── scenes/    # example scene JSON files\n├── docs/      # design spec + per-phase implementation plans\n└── legacy/    # original 2023 SPH+OpenGL code preserved as-is\n```\n\n## License\nTBD — currently personal portfolio.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqervas%2Fwater_simulation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fqervas%2Fwater_simulation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqervas%2Fwater_simulation/lists"}