Unity Shader: Dissolve Shader
In this article I'd like to show you a quick and easy way to implement the dissolve effect. Mind you, the code is not optimized to make it easier (hopefully) to understand. Let's begin! The Dissolve Texture First of all we need a dissolve texture and we can generate it ourselves using Photoshop Cloud filter. Here's mine: The Shader Add a new Standard Surface Shader in Unity. Add two new input properties to our shader: 1 2 3 4 5 6 7 8 Properties { //...Other shader properties //Dissolve Shader Properties _DissolveTexture ( "Dissolve Texture" , 2D ) = "white" {} _Amount( "Dissolve Amount" , Range( 0 , 1 )) = 0 } _DissolveTexture is where we put our dissolve texture _Amount represents the progress of dissolving our object (0 = visible, 1 = disappeared) In the surf function is where the magic happens! We get the dissolve_value by sampling the color of our _DissolveTexture using the