LabX aims to simulate chemistry and physics experiments in Mixed Reality for educational purposes. I implemented and optimized the whole real-time, screen-space fluid rendering pipeline of LabX and achieved an average frame time of 9.02 ms on GeForce GTX 1060 6GB when simulating 20K particles at 1080p.

LabX Demo Video - Fluid Rendering Part

Key Activities

  • Rendered smooth particle-based fluid in real time with the screen-space filtering approach (20K particles, 1080p, 9.02ms average frame time on GeForce GTX 1060 6GB)
  • Calculated and applied particle anisotropy efficiently using compute shaders to improve surface smoothness
  • Implemented and compared two common filtering approaches, screen-space curvature flow and bilateral filtering
  • Identified performance bottlenecks with tools such as Nsight, then reduced bilateral filter running time by up to 27.9% using techniques such as utilizing shared memory and employing loop unrolling

Pipeline Performance Metrics

The fluid rendering pipeline was tested in two different test scenes. The first "Single Dam Break" scene only tests the rendering of simple fluid, while the second "Fluid–rigid body Interaction" scene trials the performance of the pipeline during the interation between 3D fluid and rigid bodies.

Performance of the single dam break scene
1080p, 3.1K particles, using compute shader bilateral filtering with a diameter of 9 pixels

Intel Core i7-6700HQ
NVIDIA GeForce GTX 960M 2GB
Intel Core i7-6700HQ
NVIDIA GeForce GTX 1060 6GB
CPU Time(ms) GPU Time(ms) CPU Time(ms) GPU Time(ms)
Cascaded Shadowmaps (4 cascades) 0.04 2.75 <0.02 0.94
Calculate Anisotropy <0.01 0.10 <0.01 0.03
Particle Depth Splatting 0.02 3.97 <0.01 1.45
Particle Thickness Splatting 0.02 0.10 <0.01 0.02
Depth Smoothing 0.02 0.03 0.03 0.01
Thickness Smoothing 0.09 7.46 0.04 2.42
Image Synthesis 0.03 0.20 0.01 0.08
Total ~0.23 14.61 ~0.13 4.95

Performance of the fluid-rigid body interaction scene
1080p, 20.2K fluid particles, using adaptive radius bilateral filtering with a maximum diameter of 41 pixels

Intel Core i7-6700HQ
NVIDIA GeForce GTX 960M 2GB
Intel Core i7-6700HQ
NVIDIA GeForce GTX 1060 6GB
CPU Time(ms) GPU Time(ms) CPU Time(ms) GPU Time(ms)
Update Rigidbody Poses 0.33 0.00 0.03 0.00
Calculate Anisotropy <0.01 0.38 <0.01 0.22
Particle Depth Splatting 0.01 11.25 0.01 4.32
Particle Thickness Splatting 0.01 0.72 <0.01 0.19
Thickness Smoothing 0.02 0.02 <0.01 0.01
Depth Smoothing <0.01 14.05 <0.01 4.17
Image Synthesis 0.02 0.30 0.01 0.11
Total ~0.41 26.72 ~0.09 9.02