'Dirt' procedure

Can’t figure out how to perform the bake…

Looking for this? It’s down, last on the Render panel.

Is there no way to do this for cycles without baking AO / dirt vertex? We have a Layer Weight node for “Fresnel” and “Facing”. I’m wondering if there is (even on the dev “to do” list) one which could be used directly as a cavity node. The method here does at least get out of having to unwrap the mesh, though it still seems like one step too many.

You can also use the Color output from the attribute node. For adjusting the amount of vertex dirt, simply add a color ramp between the attribute node and the mix node and you can use the black and white levels to add/subtract the value of the dirt. I do this instead of redoing the dirt.

No, what I was meaning is whether there might be something to bypass the need for the dirt vertex paint. Not that it’s hard to do (I’ve used the tutorial and am familiar with the steps). Something in the way of a straight cavity node similar to AO?

is there any way to do this yet without needing to pre-bake the dirty vCols? Cycles really needs an AO/Cavity-type node to handle this dynamically, unless i’ve missed that its already in there

there is an AO shader now, but the results aren’t as I would like them to be. I guess you might try mixing two of them, one white and one dark grey, and use a Layer Weight node to facing for getting a cavity effect.


One of the problems (that or I lack the expertise in Cycles) is that AO is a shader.
You can’t use it to mix two other shaders, which would be nice for instance having a glossy for metal and a diffuse for paint and use the AO shader with some noise as “weathered mix” input.
But that’s not working as it is shader. And you can’t bake it to a texture either.

So, am I missing something or is there a way to convert hte shader output into something the factor input of a mix shader understands?

@Craig Jones , thanks for sharing your approach. Its better than nothing, I’ve been using a different approach by mapping camera & lights rays with cycles nodes, but havent come close to an actual cavity shader. That said, there IS a cavity shader in cycles if you’re using OpenSL, this should REALLY be ported to Cycles materials nodes itself.

I know, the shader doesn’t afford the same ability I get from using the vertex paint method or even baking out the AO to a uv mapped image. When baking comes to cycles, we might see some options that are better than what we have now, but for now I don’t mind just pressing a few buttons to get my vertex color so I can use my attribute node as a stencil between shaders/textures.

If OSL has a cavity shader, how does that output translate into the same style of stencil/factor input?

Does the AO node actually work as AO? The Layer Weight node works more like normals-to-camera than cavity so a good effort, yet the effect is not the same.

thanks for this brilliant tutorial - worked first time after much frustration before I read this. It’s just persuaded me to join blenderartists!

The only difficulty with the tutorial is understanding that pressing the Dirty Vertex Colors button in the Paint menu on the 3D Viewport Header when in Vertex Paint mode IS the AO Bake Command referred to in the rest of the post.