PDA

View Full Version : secondary depth shader


jashiin
04-05-2006, 01:12 AM
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! :)

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
http://spirou.se/shaders/spr_secondary_depth1.jpg


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


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

Gal
04-06-2006, 08:07 AM
but, you are missing a maya script file in the zip? cant see it in maya..thus cant create it?

Puppet|
04-06-2006, 09:01 AM
http://www.puppet.cgtalk.ru/download/z_e.shtml

jashiin
04-06-2006, 09:46 AM
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

Gal
04-06-2006, 09:51 AM
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.

Puppet|
04-06-2006, 10:15 AM
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 :)

jashiin
04-06-2006, 11:07 AM
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

noxy
04-06-2006, 06:22 PM
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

YourDaftPunk
04-07-2006, 05:17 AM
http://www.pbase.com/sonnyandcher/image/49697337

jashiin
04-07-2006, 07:18 AM
i wanted the secondary depth map to fake blurry reflections like the one in the floor here

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

[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

CGTalk Moderation
04-07-2006, 07:18 AM
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.