Exactly! The main thing you need are gradient texture and a crack texture. You can also use UV node instead of a gradient texture. Anyway, they are used to make a ‘reverse corrosion’.
Note: I use Unity’s Shader Graph to make this, but Unreal’s Material Graph should have all the nodes and works the same since we mostly uses add, multiply, etc.
Here is the basic result
The only thing you need is a crack texture
Texture
Now for the shader/material part
Gradient Ramp
The graph here creates a gradient that has its white part ‘eaten away’ based on Reveal parameter. 0 means the gradient is completely blank, while 1 means the gradient is completely full. The movement goes from the brighter part of the gradient to the darker part.
The last Lerp node dictates how bold your ‘fade’ is. The value of A is 0 while B can be whatever. The higher it is, the bolder it will be. You don’t have to use it also if you don’t want to.
- I use UV’s G channel (circled in blue) to create a vertical gradient, but you can replace it with texture.
- If you want to ‘animate’ the shader in particle system, replace Reveal parameter with Custom Parameter node in Unreal (I think that’s the name), and drive the value over time in your particle system of choice.
Mask Texture
A simple Texture2D setup. You really need only those circled in yellow. Other nodes are just for my convenience.
Output
Multiply the output from Gradient Ramp and Mask Texture, put it in Saturate, and that’s it. I have additional nodes here to change how bold it is and stuff, but you don’t have to have it.
Now you can plug it into the material’s alpha and change the color to your liking. When you use it, animate the Reveal value from 0 to 1, or use the Custom Parameter graph. Whatever to your liking.
Now, if you want it to ‘expand outward’ like the earth is pierced, like this:
Then you just have to replace the UV’s G channel (circled in blue, in Gradient Ramp part above) with a texture shaped like an arrow with faded tip, like this:
Texture
Hope this helps!
Edit: If you want to ‘reveal’ mesh vertex instead of just texture, you can play around using the Output to calculate vertex position and so on.