← Back to Home

Ignis Divinus

Final Report - Full Technical Version

Real-time 3D Fire Simulation - CS 184 Summer 2025

Chenyang Zhang
Huachen Qu
Muze Du
Yijun Xiang

Abstract

We present Ignis Divinus, a real-time 3D fire simulation system that achieves physically realistic flame behavior through GPU-accelerated fluid dynamics. Our implementation combines stable Navier-Stokes fluid simulation with volumetric rendering techniques, leveraging Taichi's differentiable programming framework for high-performance computation. The system features a Semi-Lagrangian advection scheme for stability, temperature-driven buoyancy for natural flame motion, and physically-based blackbody radiation for accurate color representation. We achieved interactive frame rates of 30+ FPS at high quality settings (96³ grid resolution) on consumer GPUs, with advanced post-processing effects including bloom and heat refraction. Our approach demonstrates that complex fluid phenomena can be simulated in real-time while maintaining visual fidelity suitable for interactive applications, games, and visual effects.

Technical Approach

Core Simulation Architecture

Our fire simulation system is built on a 3D grid-based fluid solver implementing the incompressible Navier-Stokes equations. We chose a Semi-Lagrangian advection scheme for its unconditional stability, allowing larger time steps without numerical explosion. The simulation operates on a staggered MAC (Marker-And-Cell) grid where velocity components are stored at cell faces and scalar quantities (density, temperature) at cell centers.

Key Technical Decisions:

  • Grid Resolution: 96³ voxels as optimal balance between detail and performance
  • Time Integration: Adaptive time stepping with CFL condition monitoring
  • Pressure Solver: Jacobi iteration (40 iterations) for incompressibility enforcement
  • Boundary Conditions: No-slip at bottom for ground interaction, open boundaries at top for natural outflow

Rendering Pipeline

We implemented a ray marching-based volume renderer that directly integrates emission and absorption along view rays. The renderer uses physically-based blackbody radiation to map temperature values to colors, creating realistic flame appearance from deep red through orange to bright yellow-white.

Initial Approach

  • Fixed step ray marching
  • Linear color interpolation
  • Simple alpha blending
  • No post-processing

Final Implementation

  • Adaptive step size with early termination
  • Blackbody radiation LUT (800K-3000K)
  • Emission-absorption model
  • Bloom + heat refraction effects

Performance Optimizations

Achieving real-time performance required careful optimization at multiple levels:

GPU Acceleration with Taichi

  • Kernel Fusion: Combined multiple computation passes to reduce memory bandwidth
  • Shared Memory: Utilized tile-based computation for cache efficiency
  • Vectorization: Leveraged SIMD instructions through Taichi's automatic optimization

Algorithmic Improvements

  • Early Ray Termination: Stop marching when accumulated opacity exceeds threshold
  • Level of Detail: Reduce simulation resolution for distant views
  • Temporal Filtering: Smooth heat refraction over multiple frames

Challenges & Solutions

Problem 1: Numerical Instability

Issue: Initial implementation suffered from velocity field explosion at high temperatures.

Solution: Implemented Semi-Lagrangian advection with CFL-based adaptive time stepping and added numerical dissipation to damp high-frequency noise.

Problem 2: Unrealistic Flame Motion

Issue: Flames appeared too laminar and lacked turbulent detail.

Solution: Added vorticity confinement to restore small-scale rotational motion lost to numerical dissipation, and introduced stochastic fuel injection for natural flickering.

Problem 3: Performance Bottlenecks

Issue: Initial ray marcher achieved only 5-10 FPS at target resolution.

Solution: Implemented adaptive step sizes, early termination, and moved all computation to GPU kernels, achieving 6x performance improvement.

Lessons Learned

  • Stability vs Accuracy Trade-off: Semi-Lagrangian methods sacrifice some accuracy for unconditional stability, but this is acceptable for visual applications where stability is paramount.
  • Importance of Physical Models: Using blackbody radiation for color mapping made a dramatic difference in realism compared to ad-hoc color gradients.
  • GPU Memory Patterns Matter: Coalesced memory access patterns provided 2-3x speedup over naive implementations.
  • Post-processing Impact: Simple effects like bloom and heat refraction contribute disproportionately to perceived quality.

Results

🔥 Arcane Blast

Arcane Blast Fire Simulation

Artistic creation showcasing the expressive potential of our fire simulation

See the video below for technical demonstrations and feature breakdowns

Detailed Feature Demonstration

Full demonstration showcasing wind effects, color variations, explosion dynamics, and real-time parameter controls

96³
Grid Resolution
30-60
FPS Range
256
Ray Steps (Max)
800-3000K
Temperature Range
40
Jacobi Iterations
6x
Performance Gain

Performance Analysis

Frame Time Breakdown (High Quality, 96³ grid)

  • Fluid Simulation: 12ms (40%)
  • Volume Rendering: 15ms (50%)
  • Post-processing: 2ms (7%)
  • UI & Other: 1ms (3%)
  • Total Frame Time: ~30ms (33 FPS)

Quality Presets Performance

  • Low (64³ grid, 128 ray steps): 120+ FPS
  • Medium (80³ grid, 192 ray steps): 60+ FPS
  • High (96³ grid, 256 ray steps): 30+ FPS
  • Ultra (128³ grid, 384 ray steps): 15+ FPS

Comparison with Reference

Our implementation achieves comparable visual quality to offline renderers while maintaining real-time performance. The key differences from production systems:

  • Grid Resolution: Limited to 128³ for real-time vs 512³+ in offline systems
  • Lighting Model: Emission-only vs full global illumination
  • Smoke Integration: Simplified density model vs separate smoke solver
  • Combustion Model: Temperature-based vs chemical reaction simulation

Despite these simplifications, our system produces visually convincing results suitable for games, interactive visualizations, and rapid prototyping of fire effects.

Team Contributions

Each team member contributed equally to the project's success through specialized roles:

Chenyang Zhang
Velocity-Pressure Solver Buoyancy Forces Boundary Conditions Algorithm Research Numerical Stability

Developed Jacobi pressure solver with 80 iterations for incompressible flow. Implemented buoyancy-driven motion using temperature gradients. Designed boundary condition handling for stable simulation. Conducted extensive research on fluid dynamics algorithms.

Huachen Qu
VolumeRenderer Class Blackbody LUT System Ray Marching Algorithm Emission-Absorption Model Flame Color Control

Built VolumeRenderer with 256-step ray marching and blackbody radiation LUT (800-3000K). Implemented emission scale and absorption coefficients for volumetric effects. Added dynamic flame tinting system for color variations during runtime.

Muze Du
Fluid3D Implementation Fuel Combustion System HeatRefraction Effects PostProcessor Pipeline Dissipation Modeling

Co-implemented Fluid3D class with velocity, density, and temperature fields. Developed fuel combustion timing and dissipation rates. Created HeatRefraction with screen-space distortion. Built PostProcessor with bloom and temporal filtering for visual enhancement.

Yijun Xiang
Main System Architecture Taichi GPU Framework Performance Optimization Adaptive Timestep Control Project Integration

Designed main.py architecture integrating all subsystems. Led Taichi GPU framework implementation achieving 30+ FPS at 96³ resolution. Developed adaptive timestep control and performance monitoring system. Coordinated module integration and project structure.

Presentation

Project Slides

Technical overview and implementation details

View Presentation Slides

References

[1] Stam, Jos. "Stable Fluids." SIGGRAPH 1999. PDF
[2] Fedkiw, Ronald, Jos Stam, and Henrik Wann Jensen. "Visual Simulation of Smoke." SIGGRAPH 2001. Paper
[3] Nguyen, Duc Quang, Ronald Fedkiw, and Henrik Wann Jensen. "Physically Based Modeling and Animation of Fire." SIGGRAPH 2002. Paper
[4] Bridson, Robert. "Fluid Simulation for Computer Graphics." CRC Press, 2015. Book Website
[5] Wrenninge, Magnus and Nafees Bin Zafar. "Volumetric Methods in Visual Effects." SIGGRAPH 2010 Course. ACM Digital Library
[6] Taichi Programming Language Documentation. Documentation
[7] Crane, Keenan, et al. "Real-Time Simulation and Rendering of 3D Fluids." GPU Gems 3, 2007. Chapter
[8] Foster, Nick and Dimitri Metaxas. "Realistic Animation of Liquids." Graphical Models and Image Processing, 1996. PDF