Cycles node to make worn edges????

Does anyone know of a function in Cycles that would mix two diffuse shaders or any shaders based on proximity to and edge to create worn edges like a lighter color on the edge with preferebly a soft border. In Carrara 3d we had that. Kind of like with dirty vertex maps input to make a factor of light or dark. It would be the inverse of dirty vertex.

What’s wrong with Dirty Vertex paint? Increase mesh resolution temporarily, bake and use as a mask to mix whatever.
OSL is, well, slow…

got one with proc text but not very strong!


or a better one


UV or OSL looks better then proc text!

happy bl

@ Ricky Blender I dont see any worn edges

Ill work on the dirty vertex option though, I dont have much experience with osl and scripting. I found the script but dont really know how to use it. What Ikarishinjii did with that hand gun is exactly what I want.

to get dirty vertex colors just make a copy of your model, subdivide it a bit, or use an applied subsurf modifier depending, then hit v to go into vertex paint mode, and from the vertex paint menu choose ‘dirty vertex colors’. then you bake your vertex colors onto the UV cords of the original model.

Exactly. And then you “just” use that bake as the mixing factor for your materials.

This is the node setup for the material in my revolver example:


Mind you, though, that this was in my very early days with Cycles and things got a little out of hand…:wink:
When reviewing that node tree today, I’m not exactly sure why I did some of the things that very way. Anyway, the important step is the Fac input of the last Mix Shader. There I used the baked “cavity” map, modulated with a noise texture to make it a little more erratic. And if you switch the inputs of the Mix shader, you don’t even have to invert the cavity map.

Perhaps it could help :

There’s also a small trick that can be usefull for some results, but it may require some tweaking on the mesh…

If you object shading is set to smooth, you can use the Dot(Normal, TrueNormal) as a mask. The principle is quite simple: the smoothing function will interpolate the true normal near the edges that have a bigger angle between the faces. The Dot function will give the cosine of that angle, which will be 1 if the faces are coplanar, and 0 if the faces are perpendicular, etc.

There are still some problems with this approach…
first, it’s difficult to check if the edge is convex or concave.
second, some meshes may need additional edges to control the width of your mask.
third is not really a problem as we can still overwrite the normals to have a flat shading even when the object is set to smooth.

Anyway, the method is simple enough to give some quick results.

@IkariShinji
would you happen to have a sample file for this complex nodes set up!
I 'd like to test it and see what it gives

here is an old thread on edge abrasion might give some ideas

[/FONT][/COLOR"]http://blenderartists.org/forum/showthread.php/194469-abrasion-generator

thanks
happy bl

Cracks & worn Edges tutorial, files & more here: http://www.cgmasters.net/free-tutorials/cracks/
Usually it’s better info & description on a channel where video is posted