UE4 : Dissolve Shader Breakdown


Result



Triplanar Noise


First, we're gonna need to have a noise Texture Panning to get some motion going. To avoid tiling on some meshes, the best way to add noise is to project it in World Space. Let's start by using a Triplanar Function and add the parameters to control the speed and the scale.



First, let's take the World Position and break it to isolate the Blue channel, you can do the same for the others if you wish. Let's one minus the output and put it in a switch with a Static Bool parameter to invert the Dissolve later on. Multiply that by parameter to control the Scale of the Blue channel independently to the other to get a stretched look if you want, i'll call it Z Scale. Then, multiply all of that by the Time mulplied by a Speed parameter to finaly get the panning.

Plug all the other parameter to the WordAllignedTexture and we are almost done. As you can see, i multiplied the time and the global scale to the Object Scale node. This is used to get an independant tiling and speed no matter the scaling of the object.

Dissolve


Now we can start the dissolve part. This was done using the BoundingBox UVW but this isn't the only solution. I decided to go with this because the Dissolve parameter can be controled within the range 0 to 1 without having to much trouble with huge float or weird range of values. Also the Dissolve parameter means that at 0 nothing will happen and at 1 the entier mesh will be Dissolved. This is useful for the user and to control later with Niagara or Blueprints for example.



First, get the Blue channel of the BoundingBox UVW and add it to the result of the Triplanar projection. You can multiply the result of the Triplanar projection by a small number to reduce the leaking and get a nice range of noise, kinda like a power. Add the result to the Dissolve parameter and plug the result in a Step with the Y to a constant 1. One minus the output and you have now a Dissolve shader. The result will be pluged into the opacity of your material.

Now let's make a copy of this but substract the Y value to a Edge With parameter. This will act a our edge mask. This mask will be pluged to the color of emissive of your material.

WPO


The final touch we can add to our shader is the WPO to get some vertex motion with the Dissolve. This can be really crucial and adds a lot to the shader even if the meshes are low poly.




For this we will only use the Blue channel of the BoundingBox UVW and not the result added with the Triplanar noise. This is because without much geometry, the result will be choppy and vertices will be moving all over the place.
We will also not be using any Step function because we want to be able to smooth out the WPO so the vertices get pushed outward smoothly. Of course this is up to you and what you want to achieve.

So let's start by adding the Blue channel of the BoundingBox UVW and the Dissolve parameter minus 0.5. Add an WPO Offset parameter, substract the result again by 0.5 and plug that into a SmoothStep. Here add the WPO Smoothness parameter. Multiply the result by the Vertex Normal on the Red and Green channel. You can use the Blue channel as you wish. Multiply that again by the WPO Intensity parameter. I choosed to multiply the WPO Intensity with the WPO Smoothness to get an independant intensity no matter the Smoothness value. Then multiply the result and plug that into the WPO.