Generating depth between materials when using vertex color

Hey everybody!

So I’m doing a material based on vertex painting with bricks/cement/plaster, and everything is fine except that all 3 of them are showing at the same depth (I’d like plaster to be on top) and I don’t know if there is a way to get a AO based on the height mask, so it’ll generate a fake shadow around it (It’s the most reasonable thing I could think about). I don’t want to use displacement if it’s possible!

Here is the material so you could see the 3 of them mixing in a strange way (the one with the holes should be the plaster, but I’m using a placeholder right now)

Imgur

Thanks for your time :slight_smile:

I would love to know why this was not answered. I think the question is well described and straight to the point. As I would also love to know how this is done, I am sure many others are in the same boat, but there should be someone out there that knows and is kind enough to share?

This was left unanswered mainly because there is no consistent way to do that.
Virtually all normal/ao map generation algorithms rely on sampling source data(height map) with an offset. And you cannot sample vertex color with an offset.
So if you are using texture mask alone, this is possible. It is not with vertex colors however.

Definately there is a way. Here at our studios we constructed a material based on Parallax Plaster Paint. The trick is in the Lerp. You need to apply a Lerp twice, one above the vertex color responsable for the plaster and one below, and both Lerps should be painted with the same vertex color. The mix map you are using to paint the plaster has a Fall Off. When you increse the fall off you will reveal the lower part revealing the AO. Now the AO is generated by multipying the previous vertex layer with 0. The result of this multiplication will be painted with the same vertex generating the parallax.