Skip to content

EPITA Courses: An OpenGL4 project where we implement water, ice, lava and fire

Notifications You must be signed in to change notification settings

AlexandreLamure/A-Shader-of-Ice-and-Fire

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

95 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A Shader of Ice and Fire

The goal of this project is to create dynamic water, ice, lava and fire in OpenGL 4.

Build and run

# Install irrKlang (needed for audio)
cp lib/irrKlang/libIrrKlang.so /usr/lib/

# Build
mkdir cmake-build && cd cmake-build
cmake ../ -DCMAKE_BUILD_TYPE=Release
cmake --build . --config Release -j

# Run
./a-shader-of-ice-and-fire

Structure

  • audio/: sound files
  • lib/: external libraries
  • models/: OBJ models
  • shaders/: GLSL source code
  • src/:C++ source code and headers

Libraries used

Features

  • Bloom + HDR
  • Lava procedural texture (Perlin customised)
  • Particles (compute shader)
  • Water reflection + refraction
  • Water displacement mapping + tesselation
  • Transition FX (Screen-Space animation)
  • Snow (Perlin noise on 3 octaves)
  • Ice
  • Sound FX

Results

The scene

We decided to create our own scene on MagicaVoxel to be as free as possible. However, we decided to keep the models simple, so that our work on the lava and ice would be more visible.

Fire mode

  • The water computes its refraction and reflection. The distortion effect is made using a displacement map. It also uses the tesselation and geometry shaders to create a tiny wave effect (changin the height locally).
  • The lava texture is made using Perlin noise. It also uses the tesselation and geometry shaders.
  • We added HDR and bloom effects.
  • Some particles are here to simulate lava ember (above the lava) and fireflies (on the water surface and gathered on the lamps). We used the compute shader and geometry shader to optimize it.

Ice mode

You can activate the Ice mode by pressing 'I'. The color of the lights switch to blue and the water freeze progressively. Some snow particles are falling down, and a snowy texture made wit Perlin noise on 3 octaves appears slowly on the volcano.

Transition

The transition between those 2 modes is pretty cool. It is progressive, and there is a nice 2D effect (using a FBO which renders the scene on a quad).

About

EPITA Courses: An OpenGL4 project where we implement water, ice, lava and fire

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published