Erasing a mask from a texture

Hello there !

So I wonder how something like a scratching game, you scratch a texture to reveal another one under it could be made in UE5? One reference I can think of is in Palia with the hoe https://youtu.be/oG2jjQcQ_V4?si=HG85xj38idIrXb9u&t=13.

Is it like a collision box at the tip of the hoe which interact on the ground with a render target ? or with a box trace maybe ? I guess it has to do with the UV’s too?

I’d like to have some clue to start with, what should i focus on to replicate something like this ?
I made a system with line trace but i have more a powerwash feeling, i’d like to make something where you have to “collide” with.

Thank you !

1 Like

Vertex painting is what you need :slight_smile:

Hi Clockwork ! thank you for your answer !

I’ve been looking into vertex painting today, i am trying to come out with a plan here:
So i need to have my material with vertex painting, and in a blueprint class actor i need to have a colision box or box trace that send information to the vertex painting mask.
I will need also to get information to tell that the mask is complete so the player can win (but i read that its more something that need C++ ). Do you think it is the right way to think about it ?

1 Like

This thread looks handy

You could use a render-target to capture the ‘scratches’ and then use that as the mask to reveal the texture.

Oh yes I’ve heard about render target too ! as @Frenetic mentionned too
Render targets looks like a powerfull but very complex tool to make many things, if i understand correctly, render target can be used to get the UV’s of a mesh and then draw on it ?

Also it’s confusing to know if it’s possible to make this system with vertex painting, some people seems to say it is not, some says it is, i found this tutorial that mixes layered material with vertex paint https://www.youtube.com/watch?v=FF5HZ6Cq8GY&t=24s so i don’t see why it shouldn’t work

Thank you again

1 Like

Yes, very easy in editor, but to get it working at runtime you’ll have to pull some strings. Something with a render target or CPP.

Thank you again, i will call this topic as resolved for now and will ask later if i encounter difficulties !

2 Likes

Interested to hear how it goes :smiley:

This is a great series around grass/snow trails using render targets, hope it helps:

there is a set of links at the top, it’s a 3 part series, start at 1

if you think about it, your screen is render target, here you are rendering from a different point of view, like you might need to if you wanted to have a live security camera. the ‘target’ is essentially a texture that you can then do whatever you want to do to textures, including painting it to a screen, like a display for a security camera, or capturing depth into the scene (looking up from below the char) to capture depth to make accurate trails.

it will cost you depending on the resolution, but you can do it as much as you want, across many things, just pay the cost. It opens up a lot of possibilities.

1 Like