Sizzling Dissolve Shader

Sizzling Dissolve shader

The important node for achieving this effect is the ‘Smoothstep’ node. It will output 1 when the input ‘In’ is between the range of a min and max value (name as ‘Edge1’ and ‘Edge2’ on the node) and 0 when the input value is outside that range.

Let’s begin by setting a constant value of 1 using a ‘Float’ node. Next, let’s subtract this value with 0.5 and 0.53 values and assign these new values to the Edge1 and Edge2 inputs of the ‘Smoothstep’ node. After that, we can sample a noise texture and use the blue channel (or any other channel of your choice) as input ‘In’ for the ‘Smoothstep’ node.

As you can see, the Smoothstep node has made everything between 0.5 and 0.47 range to black and everything outside that range to white.

Let’s replace the constant ‘Float’ node with a ‘Time’ node to make the Min and Max range dynamic and animate our final output. Since we want the animation to be sinusoidal / oscillating, we’ll use the ‘Sine Time’ value. To reduce the strength of the sine wave, we’ll multiply it by 0.5, and then add 1 to make the sine wave range between 1 and 2.

Now you will see animated smoothstep output.

Let’s create a new smoothstep setup with a range shifted by 0.03 to achieve narrow-edged noise lines. The new range should be between 0.5 and 0.53.

Now subtract both smoothstep values to get the desired effect.

To make an object appear visible only in the white areas and invisible in the black areas, we can use a technique called ‘Alpha Clipping’. This technique involves rendering the object only when the alpha value is greater than 0. To achieve this, we need to assign the output to the ‘Alpha’ input of the ‘Fragment’ shader.

Make sure to enable the ‘Alpha Clipping’ flag in the ‘Grapph Inspector’.