Skip to content

Instantly share code, notes, and snippets.

View NiallHornFX's full-sized avatar

Niall Horn NiallHornFX

View GitHub Profile
@vassvik
vassvik / Simulation_Projection.md
Last active June 13, 2024 09:23
Realtime Fluid Simulation: Projection

Realtime Fluid Simulation: Projection

The core of most real-time fluid simulators, like the one in EmberGen, are based on the "Stable Fluids" algorithm by Jos Stam, which to my knowledge was first presented at SIGGRAPH '99. This is a post about one part of this algorithm that's often underestimated: Projection

MG4_F32.mp4

Stable Fluids

The Stable Fluids algorithm solves a subset of the famous "Navier Stokes equations", which describe how fluids interact and move. In particular, it typically solves what's called the "incompressible Euler equations", where viscous forces are often ignored.

Compute memory access pattern throughput benchmarks

We test the runtimes of simple compute shaders reading from one 3D texture using some kind of filter, and writing back to another texture. The local work group size of the compute shader is varied for some arbitrary set of work group sizes, and the effect of different internal texture formats are studied.

All tests are performed using 512x512x512 3D textures. At this size memory throughput and latency will be the primary bottleneck, so any extra calculations should have negligible impact on the timings.

All timings are measured by averaging the frame time across 128 frames, with a 128 frame warmup, with vsync disabled. Using queries might provide more stable numbers.

The work group sizes are:

@reinsteam
reinsteam / atmosphere_clouds_rendering.md
Last active March 1, 2024 14:43
A collection of links to various materials on atmosphere / clouds rendering

Atmosphere / Clouds Rendering

Research papers

Atmosphere

  • A fast, simple method to render sky color using gradients maps [[Abad06]]
  • A Framework for the Experimental Comparison of Solar and Skydome Illumination [[Kider14]]
  • A Method for Modeling Clouds based on Atmospheric Fluid Dynamics [[Miyazaki01]]
  • A Physically-Based Night Sky Model [[Jensen01]]