[Unity][Shader] Stylized Fog


I wrote a simple shader for Unity to make a stylized fog like Fire Watch's fog. The idea is to get a pixel on the texture depending on the pixel depth, if the fog is near, a pixel on the left on the texture uv will be picked, if the fog is far, a pixel on the right on the texture uv will be picked.

Features

  • Choose between a linear fog and an exponential fog
  • Choose between a simple color or a texture

Screenshots




Video


Source Code

Image Effect Version (Unity 2017 and older if not using Stack)






Stack Version (Unity 2018)





On your post process volume, click on add effect and you should see the shader in the "custom" category. Edit it as any other post process effect.

Comments

Popular posts from this blog

[Unity] Flight Camera Character Controller

Tetris in C++ with SFML