2d Raymarched Smoke

Start with a texture as opacity. Here I'm using a flat splat texture to better show the offset layering.

Take a copy of this, offset it by the LightDir in tangent space by adding to the UVs. Do this again with an increased offset and then layer them together. This is the shadow side. 

Now take another two copies of the texture, again offset by the LightDir in tangent space, this time by subtracting from the UVs instead of adding. Increase the offset and layer those together.

This is the lit side.

We can use the Dot Product of the ViewDir and LightDir to Lerp blend between the negated shadow side and the lit side.

Perhaps use a smoothstep to ease the transition.

Now just chuck out that flat shaded splat texture, and pop in a soft smoky texture with faded sides.  

Multiply it by the Light Colour, and if you’re feeling extra fancy, use the Dot Product of the ViewDir and LightDir to add in some fake SubsurfaceScattering as the light travels behind the smoke.  

Become a patron to

Unlock 41 exclusive posts
Be part of the community
Connect via private message