Partially change material of mesh at runtime

Hi all, I would like to have a dipping effect at runtime, which means that a mesh can change its material for those parts that intersected another volume. It’s like dipping a brush into a paint bucket and then pull it out again. Those parts that have been dunked into the paint have then permanently a new material.
Is this something one can implement with ue4? Any ideas? Thanks for your help!

72693-orange-paint-dip_300.jpg

Hello Carl Mahnke,

This is something that is possible, but will require some intermediate to advanced knowledge of Dynamic Material Instances and Material Parameter Collections in order to change the affected object’s material at runtime. To learn more about these techniques, we have some really helpful documentation that you can follow to understand it better.

Material Instances

Material Parameter Collections

In your case, you will probably want to have the mask as an alpha with additive color and modifiable opacity. This way, when you dunk the paint brush into the color, you can set the opacity of the mask to an opaque value, and add color at the same time.

Cheers,

Hi Andrew, thanks for your ideas. Working with a mask was also my first thought, but here comes the catch, where I think UE4 is reaching its limits. As the paint brush can be inserted into the paint bucked in any angle and also multiple times I need something like a dynamic mask.

So your next task is going to be running traces on the geometry, so that no matter what angle you are placing the brush into the paint, it can correctly apply the material instance parameter.

This is something that is going to take some time to test and attempt as I have not tested this example myself, but in theory it should work pretty straight forward.

Let me know if you get stuck or need further advice.

Thanks,