So, I’m struggling with the next problem. I’m creating a Deferred Decal Material, it’s basically a shield hit effect that will be added on top of a shield mesh.
Well, thanks J000J, you have contributed to the solution. The thing was that I was using ImpactPosition as a default (0,0,0) and of course, every time I tried to test the decal on a surface, the value for the center of the sphere was waaay too far. I’ve replaced ImpactPosition with ActorPosition and that’s it, now it works like a charm.
The InputParameter “ImpactPosition” default value is (0,0,0). When testing the decal (without injecting some value into the input) the material doesn’t work. That’s because the value of the center of the sphere is always (0,0,0) and is way too far from the world position of the material pixels, therefore the sphere mask radius never reaches its target.
The Solution:
Replacing the “ImpactPosition” InputParameter node by a ActorPosition node fixes the problem right away. Another solution is to inject into the input parameter the current position of the decal, but that forces you to inject through code or BP to have a preview on real time in your game.
For either case, the real-time preview in the MaterialEditor doesn’t show the right effect, it only flashes. I think that’s because it cannot calculate the ActorPosition yet.