this is what I want to achive:
I want an animated mesh changing its material for those parts that go below a certain level (e.g. a Z value) or intersec with another mesh/volume. Both ways would work for me. Then, when going up again (or leaving the intersection), all changed parts should stay changed. Its like dipping a stick into a bucket of paint. Once a part was painted it will never go back.
What I tried:
In the material editor I can get the absolute world position, filter it by Z axis and pan a half-half (upper half white, lower half black) alpha mask texture. The mask is then used to lerp between two textures With this, the material can change for all parts that undergo a certain level and it works at runtime too. Now comes the tricky part. The changed parts mustn’t change back when the mesh rises again. Therefore I want to access the alpha mask to store it and merge it with the new alpha mask after a change of position has occured. Please see the blueprint. The problem is that I was not able to figure out how to access the result of “Blend_Darken” if this is even possible.
What might be a better idea:
Also, I thought about using vertex painting at runtime but I’ve read that it is not possible at runtime.
What are your thoughts on this problem?