CS-184 Final Project Proposal-Fluid Animation on GPU

Team Members: Xuanye Chen, Zhenzhe Li, Ruijie Jian, Huasen Xi

1. Summary\text{1. Summary}

In this project, we aim to implement an extendable and efficient fluid simulation system on GPU. We will also implement a high-performance wavefront path tracing renderer to render the fluid data created by the simulation system.

2. Problem Description\text{2. Problem Description}

Fluid simulation is a fundamental and highly mature field in computer graphics. However, physics based fluid simulation requires expensive computation on particles and grids to produce realistic simulation result. Since the fluid simulation is highly parallelizable, it is a perfect candidate for GPU acceleration. However, achieving high performance on GPU requires careful design and optimization of the simulation algorithm, and once it is done, we can create fluid animation much faster than CPU-based simulation.

Path tracing is also a fundamental rendering technique in computer graphics. Just like fluid simulation, it is parallelizable and can be accelerated by GPU. But to utilize the architecture of GPU, we need a method called “Wavefront Path Tracing” to reduce thread divergence. Once this is done, we can render the fluid data created by the simulation system much faster than CPU-based rendering. And to render the volume data produced by smoke simulation, it is possible that we will need to implement a volumetric path tracing algorithm, which is far more complex than the surface path tracing algorithm.

There are several challenges in this project. To better preserve the volume of incompressible fluid and reduce numerical dissipation, we will need to implement a good advection solver. To solve the projection poisson equation efficiently on GPU, we need a parallelizable preconditioner for the conjugate gradient method. Another difficulty is to implement a wavefront path tracing renderer that can handle the fluid data and smoke data. The most challenging part, however, lies in the performance optimization of both systems. Transplanting a fluid simulation algorithm from CPU to GPU and make it run is not hard, but to make it run fast is a different story. The same goes for the path tracing renderer.

We will use PIC/FLIP method to solve advection, and we will use multigrid method to precondition the conjugate gradient method. As for voumetric wavefront path tracing, we will use the null-scattering method to render heterogeneous media.

3. Goals and Deliverables\text{3. Goals and Deliverables}

Our final project include 2 sub-projects: a fluid simulation system and a wavefront path tracing renderer. And we will use them to produce a video which shows the fluid surface and cloud rendered by the path tracer. All of the computation works are done on GPU and we will implement them using modern C++ and CUDA.

The final projects don’t need to be completely real-time, but we will seek to improve the performance as much as possible. One member of our team has already implemented his own fluid simulation system and volumetric path tracer on CPU, and we will use them as a reference to evaluate the performance of our GPU-based system.

As is said before, we plan to deliver to systems that have the basic functionalities of fluid simulation and path tracing. This is not that hard, but it is possible that we might not be able to implement multigrid preconditioner. It is also possible that porting the volumetric path tracing to wavefront path tracing framework is hard and we cannot parallelize it efficiently. But we still hope that the fluid simulation can run with 64364^3 resolution in real-time if we don’t count rendering, and the path tracing renderer can render the scene much faster than CPU-based rendering while guaranteeing the physical correctness of the rendering result. If things go smoothly, we might be able to finish both systems and have sufficient time to do performance engineering and analysis.

4. Schedule\text{4. Schedule}

  • Week 1: Finish basic wavefront path tracing renderer based on HW-3. Porting fluid simulation to GPU. Implementing prototype of the multigrid preconditioner.

At this stage, Xuanye Chen will account for the wavefront path tracing renderer on his own, and he will also help Zhenzhe Li to port the fluid simulation to GPU. Huasen Xi will be responsible for the prototype of the multigrid preconditioner, and Ruijie Jian will test the correctness of his prototype.

  • Week 2: Xuanye Chen will start on the volumetric path tracing on GPU. Zhenzhe Li and Xuanye Chen should finish the fluid simulation framework on GPU. Huasen Xi and Ruijie Jian should finish the multigrid preconditioner prototype.

  • Week 3: Xuanye Chen should finish the volumetric path tracing on GPU. Zhenzhe Li and Xuanye Chen should finish porting the multigrid preconditioner to the fluid simulation system. Ruijie Jian should test the correctness of the whole system.

  • Week 4: Performance optimization and video production. Xuanye Chen and Zhenzhe Li will analyze the performance of the fluid simulation system and renderer. Huasen Xi and Ruijie Jian will run the CPU-based fluid simulation and path tracing on single scene for comparison. The four of us will work together to produce the final fluid animation.

5. Resources\text{5. Resources}

Rendering:

Fluid Simulation:

Others:

  • A Multigrid Tutorial, Second Edition, by William L. Briggs, Van Emden Henson, and Steve F. McCormick

  • CUDA Programming Guide

We will mainly use Linux system as our development environment. For CPU version of fluid simulation and path tracing, we used TBB for CPU parallelization and glm for basic vector and matrix operations. For GPU version, we will use CUDA and that requires a Nvidia GPU with CUDA support. Besides the above libraries, we will not use any other third-party libraries in core computation part of our project.