secondary depth shader


hey all!
wrote a little mental ray shader tonight, after finally getting an idea for a shader. the basic idea is to get a depth map for reflections, so you hook it into a surface, like a shiny floor or something, and it renders the depthmap after it reflects onto that surface, so it´s like “secondary depth” or something, to use in compositing, for blurry reflections and stuff like that. probably there´s already a standard way to do this, or a shader already, but now you´ve got another one! :slight_smile:


don´t laugh at my screenshots, they´re for illustration, not for a cg award :P

the shader applied to a simple plane

should work on any geometry, like this deformed grid

take a peek and tell me if you find any nasty bugs or have any suggestions


but, you are missing a maya script file in the zip? cant see it in maya…thus cant create it?



on my system it’s available from Assign New Material directly, and in the Hypershader in Create -> mental ray Materials, so i didn´t make any script for it, sorry.
i´ll be closing this thread in a little while though, since this shader seems to be redundant.



puppet’s shaders are nice but they come in 1 pack, i would rather use yours to get that exact pass than have 2 mil nodes installed that i dont even need.
with all do respect puppet, thanks for the shaders but 1 pack is… a bit annoying.

oh and i see it, you are right. no need for the script, i didnt spot it the first time due to…too many useless shaders in there already…like all the p_ ones :P.


to Gal:

If you don’t need other shaders just comment it in mi file, it’s not problem.
Single pack is better than have millions of dll and mi files installed :slight_smile:


i personally prefer simple shaders that do one thing, instead of one universal shader to solve it all, so i´m happy you find it useful.

because of stupidity i didn´t check transparency of objects, i´ll fix it tonight and put up a new version.



perhaps I’m mistaken here, but don’t reflection and refraction happen at the surface of the object doing it? e.g. if I’m looking at a drop of water with other leaves out of focus in the background, the leaves refracted through the drop will typically be in focus. Wouldn’t you get some strange effects by calculating the reflection into the depth?
Insight appreciated.





i wanted the secondary depth map to fake blurry reflections like the one in the floor here


 [not my image, just a google image example]

 that´s about what i expect you could fake without too much hassle
 hope that clarifies the intention of the shader!


This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.