secondary depth shader


#1

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:

[download](http://spirou.se/shaders/spr_secondary_depth.zip)

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

the shader applied to a simple plane
[img]http://spirou.se/shaders/spr_secondary_depth1.jpg[/img]


should work on any geometry, like this deformed grid
[img]http://spirou.se/shaders/spr_secondary_depth2.jpg[/img]


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

#2

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


#3

http://www.puppet.cgtalk.ru/download/z_e.shtml


#4

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.

jens


#5

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.


#6

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:


#7

Gal:
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.

jens


#8

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.

thanks

Noxy


#9

http://www.pbase.com/sonnyandcher/image/49697337


#10

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

 [img]http://www.packshot.com/html/images/wwd/beverage/image10.jpg[/img]

 [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!
 
 jens

#11

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.