The thing is, every time I paint, I get that vertex color falloff. I was wondering if I could get a crisp kind of falloff with a mask? Like paint splatters, or chipped paint?
ya i set it up to take a heightmap and 2 vertex colours one vertex colour does the blend the 2nd lets me paint in how hard or soft the transition should be.
I also made it a material function since i re use this a lot, and it helps to have it accessed as one node.
here is my material function.
and here is a very basic usecase for it.
i generally use the hightmap of a texture for this and blend things into the cracks, so it blends into the blacks on the heightmap first, if you need it to work in reverse you can just 1-minus your hightmap.
Right now you have it setup to paint in the cracks of the heightmap first, then the rest. How would you set it up to paint in the cracks of a normal map instead of a heightmap?
best i could think of is using dot products to find all parts of the normal map in a steep angle to create a mask, but that would be rather expensive, your best to just create a height-map.
There is no reliable way to get heights from a normal map, but off the top of my head you could do something like this, to get the edges of a normal map and use them for masking.
Replies
Am I doing it right? Or do you think I could make it more efficient?
Sorry, I'm still learning this engine. Could you explain in a bit more detail.
I also made it a material function since i re use this a lot, and it helps to have it accessed as one node.
here is my material function.
and here is a very basic usecase for it.
i generally use the hightmap of a texture for this and blend things into the cracks, so it blends into the blacks on the heightmap first, if you need it to work in reverse you can just 1-minus your hightmap.
Right now you have it setup to paint in the cracks of the heightmap first, then the rest. How would you set it up to paint in the cracks of a normal map instead of a heightmap?
There is no reliable way to get heights from a normal map, but off the top of my head you could do something like this, to get the edges of a normal map and use them for masking.
if your worried about texture calls you could always save the hightmap into the normal maps alpha, or could save it into 1 channel of a other map.
Still, the slope is pretty different from the height and might look strange if you use it as a replacement.