View Full Version : Object visibility grey scale shader for Mental Ray

November 3rd, 2008, 20:59
I’m trying to find a shader that looks at an objects visibility track and created a greyscale map of that value. I then plan to use this as a blend map, or cutout map, in order to get Mental Ray to obey visibility of objects.
I am a new Mental Ray user. I have been using scan line for years to create complex mechanical visualizations. I recently decided that I should investigate Mental Ray. I have been very impressed so far. However I was very shocked to find out that there is no way for Mental Ray to recognize the visibility track of an object. Yes, yes, I know that you can: use blend material or cut-out map etc….. However this introduces a huge problem: I need a material for every object I need visibility for! I regularly fade in and out hundreds of parts, at different times, in different selection sets, at different visibilities. There is only one practical way of doing this, the visibility track.

Is it theoretically possible to create a texture shader that looks at an objects visibility track and creates a greyscale representation of it?

Are there any shaders out there? I don’t think so, ive been looking all %$”£$% ing weekend.

Are there any fancy shaders out there that can be adapted to this purpose?

Are there any, wonderfully smart, intelligent, kind scripting gurus out there that want to have a go at this? I get the feeling that if you know what you are doing, this will take 5 minutes!

some other interesting things I have found out on my google travels:

One material, lots of colours!!!!:
David Baker WireColor v1.1
http://www.maxplugins.de/mr_files/maxpl ... r_v1.1.zip (http://www.maxplugins.de/mr_files/maxplugins/WireColor_v1.1.zip)
very cool shader. Gives me hope that it is possible to do a similar thing with the visibility track.

Ambient Occlusion that respects transparency!!! Finaly:
Holger Schönberger BA_color_raylength v22.0.4
http://www.maxplugins.de/mentalray.php? ... ort=Author (http://www.maxplugins.de/mentalray.php?search=ray%20length&sort=Author)

A contour shader that will take a map for the line thickness, hopefully enabling visibility effects, when combined with the shader im looking for:

So from the above you can probably guess what im trying to do!?!?

Im looking for a material that uses:
Transparent AO
Transparent Contours
Easy colour assignment
And takes advantage of the A&D shader

So all the pieces are there, except the link to visibility track.

I (and a huge number of other new mental ray users) would greatly appreciate any help.



November 4th, 2008, 18:30
You can also write your own shader, that supports all of it, it's not that hard if you're into programming mental ray. And the integration in your 3d application of choice shouldn't be that hard too. (for example in maya it's pretty simple)