How to blend materials from one side to another with a mask? [painting walls at runtime]

I want to implement functionality of paiting walls.
For example the wall has some texture of wood and it’s red coloured on the beginning. When someone click on the wall and keep it the mouse button down I want to gradually paint it from top to bottom. Also there should be a uneven pattern on the bottom (icicles in my case).

Here you can see what I want to achieve:

The green icicles should be slowly going down and everything what is above them should have a tint of green and eventually fulfill the whole wall so it becomes green.

Here is what I have right now (the result is the wall number 2 from above):

I tried also to move the texture mask. It moves down but obviously it leaves the red colour:


How can this be done?

Hi codeedward1,

There’s a trick - if you change the Drip Masks Texture Sampler to “Shared-Clamp” then you can use negative UV’s and they just clamp to the edge:

PaintDripping

1 Like

Hi @RecourseDesign

Thank you for your reply. This is exactly what I wanted to achieve! Really nice trick!

1 Like