2D Raymarching Smoke

I’ve always thought about the rendering of smoke. Epic’s Tech Artist Ryan Brucks also has a Raymarching Smoke Tech but it looks heavy for me. Then I saw a list of Uncharted 4 sessions at SIGGRAPH 2015. It dealt with 2D Raymarching Smoke, so I looked for the release PPT. I found it on the Realtime VFX Facebook Group and tried to implement 2D Raymarching Smoke in UE4 and finally succeeded!

Lit Particle makes smoke particles realistic but it can’t handle volumetric shading. Using Normal Map with smoke particles, I can shade volumetric but it sometimes looks 2.5D. It also can’t cover sub surface scattering. 2D Raymarching can cover all of these things (volumetric, SubSurfaceScattering), and 2D Raymarching Smoke requires only alpha texture, which allows us to save texture memory.

Technology

Guerrilla’s raymarching cloud is different than 2D Raymarching Smoke. Guerrilla produces a more physically correct model. 2D Raymarching Smoke is not exactly the most accurate raymarching.

The basic concept behind 2D Raymarching Smoke is to sample the alpha texture in the direction of the light vector. It’s very important to sample the ‘alpha’ and not the ‘diffuse’ in smoke raymarching because you have to think of the alpha as the density of smoke. Where Alpha is 1, it’s a thick area where light cannot penetrate. Where Alpha is 0, there is no smoke, so every light can penetrate.

Here’s an example of the basic concept behind 2D Raymarching.