Insert your custom message here. close ×

Dissolve – A unreal 4 shader effect.

In 404Sight we needed a cool effect that could be used to make assets and other things fade in and out of the world. and that’s how the Dissolve effect was born. The images in this will give a more technical look as to what’s going on.

Over all the way i pull this effect off is threw some pretty standard methodologies of shaders effects. we start with animating a height map, or the alpha of a texture if you painted that in its alpha channel.


Animate Height Map Function

As you see above we take our textures and subtract time out of if so we can animate the alpha. Doing that’s causes the white or blacks of the textures, depending if you reverse time or not, to fade into the other value. Multiplying said animated texture just lets you ramp up and down the whites and you see fit, in this case i took it all the way white. Clamp the values just to keep things nice neat and in control.


The meat of the Color

Above we get to see the function in action. AFter you give it the the maps and values it needs it becomes the meat that you control the whole effect with. Lerping the map ¬†with two other Maps lets the colors fade from one to the other. Here we see it fades from white to the red tiled texture. In the case with 404Sight we have things fade in and out so its lerped together again but the reverse of of the color maps. I also used If’s and scalars to give us control of how we used the effect. At this point the colors will be dissolving together but to really sell the effect you need the emissive edge.


There’s the meat again


Like with the color the animate height map is the key here, but with much less fed into the white controls so the map is much softer. We lerp that as the alpha, with pure black as A, and a reverse of the original animated height map together. Multiplying that by the new Height map gives is a very fine edge of white on the outside of where the color would be. Ceiling that will pull the whites to the full value of 1, making ripe to be used as an emissive mask. Assuming the timing on your animate height maps are the same.



Share : facebooktwittergoogle plus

Leave us a comment

Comments are closed.