I needed a shader for animating UVs, so I started by creating a simple template for smoke in Shader Forge for Unity. The shader tree allows for three diffuse textures which blend together and animate separately giving depth to the motion. There is also control to multiply a blend texture to simulate the smoke getting darker or lighter as it rises. There is also a color node to allow the color of the smoke to be changed in Unity's inspector. The last thing I did was to add in a hook for alpha transparency. Each cloud image carries with it an alpha mask as a 32-bit targa file masking the dark portions of the image. Blending these alphas and connecting them to the alpha transparency node allows for the smoke to not totally occlude what is behind it if that is needed. A similar effect could be attained through alpha transparency at the vertex level, but placing it in the animated UVs makes some of the smoke opaque while other parts are translucent. The last test that was done was connecting the alpha masks to the clip alpha and the result gives an effect more like calm water reflections which would be very useful for simulating water surfaces. 
The smoke shader to the left animates UVs with hooks for alpha transparency while the shader to the right uses the alpha as a clip alpha and works more like water surface reflections allowing for flexibility with the shader.
The shader node tree illustrating the blending of the diffuse textures with color and value and hooks for alpha.
Back to Top