Is it possible to create a shader that displays curvature?


#1

Other software has shaders that will color an object based on curvature, e.g. sharp radii appear red, flat areas appear green, and everything in between.

Here’s an example:

Is it possible to make one in Maya?

Thanks in advance


#2

you can do it or get pretty close by using two mental ray round corners nodes, one with a radius of 0 and the other with a radius that you adjust, then have both plug into a vector product node - I think set to dot product, but my memory is fuzzy. Someone has a blog about it. You’d have to remap it’s output to a ramp to get the colors you want.


#3

Is this the blog entry that you mean?
http://materialism-blog.blogspot.com/search?q=vector

This seems like it’s good for shading convex radii, like the opposite of AO normally does.

What I’m wondering though is could a shader be created that colors abrupt changes in curvature (like radii) but also more subtle undulations, like those shown here:

Thanks for the quick response! :cool:


Node Material: Curvature Shader (e.g. Edge wear or grundge ...)
#4

yeah, that’s the blog I was thinking of.

There is a way to do what you want with a NURBS surface where its surface’s world space output combine with the U and V output from a sampler info node both plugging into a pointOnSurface node then going into a vector product node (set to cross product) via the pointOnSurface’s tangent U and V outputs.

I’m not sure how it could be done with polygons. I have a feeling it could be done, but also could be computationally expensive to do where it would have to evaluate every triangle, etc if you have a dense model.

I’d be more inclined to explore getting a result via raytracing each pixel via a combination of AO and the “reverse AO” from the blog, but maybe someone knows a better way.


#5

Hmmmm…If I ever come across a way, I’ll post it here. Thanks for the input! :beer:


#6

Hi,

If you use VRay, you have a curvature texture node. Easy.


#7

Mental ray only in Maya only, unfortunately.

I found this plug-in which looks PERFECT: http://www.creativecrash.com/plugin/curvature/feature_requests/799#tabs

but it’s so old it wasn’t even working with Maya 8.5 any more, let alone 2015. There are several requests for it to be recompiled for 8.5, so I’m assuming it never was.


#8

I could be wrong, but that plugin looks like it’s just for viewport use with openGL. If it was a mental ray shader, theoretically it would still be usable today