Fire Simulation
Jun 2, 2023

- Team project (3 members)
- Grade: 5.5 / 6
TL;DR
- Built a particle-based fire simulation in C++/OpenGL with realistic and magical firepits.
- Implemented billboards, blending, Perlin noise smoke, and textured rocks for realism.
- Added Bézier camera paths for cinematic demo videos.
- Achieved a grade of 5.5 / 6 in the project.
At a glance
- Role: Graphics programmer (team of 3)
- Timeline: Apr–Jun 2023 (8 weeks)
- Context: EPFL Computer Graphics course project
- Users/Stakeholders: Students, teaching staff, and demo showcase audience
- Scope: Particle blending, Perlin noise smoke, Blender scene setup, multiple firepits, Bézier camera paths
Problem
Simulating fire and smoke in real time is notoriously hard:
- Particles must move, shrink, and blend naturally.
- Textures need to avoid visible edges.
- Cameras should follow smooth cinematic paths.
- Realistic and fantasy (“magic”) effects both need to be supported.
The challenge: can we build an efficient simulation that runs in real time, looks visually convincing, and is flexible enough to showcase different fire styles?
Solution overview
We designed a modular OpenGL simulation featuring:
- Particle systems with Gaussian spawning and size evolution.
- Billboarding for rendering efficiency.
- Blending, Gaussian filters, and noise-based textures for realism.
- Rock meshes and textures for environmental context.
- Extra “magic” firepits with custom particle textures.
- Automated camera paths with Bézier curves.
Architecture
- Particle system: spawns particles with Gaussian distribution, shrinks them along Bézier curves, and applies blending.
- Rendering pipeline: OpenGL shaders (GLSL) handle billboards, blending, and Perlin noise textures.
- Environment: Blender-modeled rocks textured and rendered before particles for smooth blending.
- Camera: Paths defined via Bézier curves (de Casteljau’s algorithm), converted to polar coordinates.
Data
- Textures: Fire/smoke images + Gaussian masks + Perlin noise-based cloud textures.
- Meshes: Rock models imported and adapted from Blender resources.
- Parameters: Particle lifetime, Gaussian spread, blending weights, Bézier control points for size and camera paths.
Product & UX
-
Primary user journey:
- Launch simulation.
- Watch realistic or magical firepits in action.
- Camera smoothly moves along predefined Bézier curves.
- Smoke, fire, and rocks render together for a cinematic experience.
-
Key features:
- Realistic firepit with smoke.
- Additional blue, green, and purple “magic” fires.
- Smooth camera paths for demo video generation.
- Interactive live demo available.
System & Operations
- Stack: C++ with OpenGL, GLSL shaders, Blender for assets.
- Rendering: Billboarding for particles, Gaussian masking, blending order fixed via depth sorting.
- Simulation: Perlin noise clouds for smoke; Gaussian distributions for particle spawning.
- Deployment: Runs locally as an interactive demo; video showcase recorded.
Impact
- Achieved realistic fire effects with blending and noise.
- Enabled creative “magic fires” by reusing particle system with different textures.
- Produced smooth demo videos thanks to automated Bézier camera paths.
- Received strong evaluation (grade 5.5 / 6).
What I learned
- How to optimize particle rendering with billboarding.
- Importance of depth sorting and blending for realistic effects.
- Integrating procedural textures (Perlin noise) with hand-modeled assets.
- Designing camera paths that enhance visual storytelling.
Future Work
- Add day/night cycles with dynamic lighting and skybox changes.
- Introduce weather effects such as wind influencing smoke and rain affecting fire intensity.
- Expand environment with dynamic surroundings (trees, grass, etc.).
- Enhance realism with HDR lighting and post-processing (glow, heat distortion).