FORUMS: list search recent posts

mental ray + layered shaders - problems with refraction through entire surface

COW Forums : Autodesk Maya

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
anthonymcgrath
mental ray + layered shaders - problems with refraction through entire surface
on Nov 15, 2005 at 12:58:21 pm

hey guys

i've got a car paint shader and I wanna make it look like rain is hitting and travelling down the car (for a closeup shot). I have my carpaint shader and i plug this into the layered shader. simple solid blinn with a colour ramp.

i now have a second fully transparent blinn. I'm using some footage of water trickling down a windscreen that looks really effective and I've tiled and looped it in aftereffects. this layer has an alpha channel and its exported as an iff sequence. its then attached to the blinn as a bump map. refractions are turned on in this blinn too.

now I want to layer this over the top so my droplets-blinn creates refractions on the paintwork surface beneath where the droplets are so I layer in the shader appropriately and go to render with mental ray but I've now got a prob - its as if the transparent blinn appears to refract right through the car - I can see the other side of the bodywork thru the paint and its refracted. this cant be right surely I just expect the blinn/droplets to refract the paintwork not look right thru. can anyone suggest what I might be doing wrong?

I'm aware layered shaders are slower but i'm prepared to wait if I get the right refractions

I've supplied some pics beneath of what I'm trying to accomplish - this is done using composited layers in afx and a fake refraction. its quite effective from a distance but up close its not quite right.

composite
http://img.photobucket.com/albums/v90/anthonymcgrath/frm260_composite.jpg

beauty
http://img.photobucket.com/albums/v90/anthonymcgrath/frm260_colour.jpg

water pass
http://img.photobucket.com/albums/v90/anthonymcgrath/frm260_water.jpg


Return to posts index

Sean Fennell
Re: mental ray + layered shaders - problems with refraction through entire surface
on Nov 15, 2005 at 7:45:29 pm

This is just speculation because I've done no tests but could it be a refraction depth set too low somewhere in your shader or in render globals? Try turning the refraction depth up to 9 in your blinn shader, and the render globals turn the max refraction and max depth up a few steps higher and see if it produces proper refractions.


Return to posts index

Steve Sayer
Re: mental ray + layered shaders - problems with refraction through entire surface
on Nov 15, 2005 at 8:24:26 pm

Anthony, Sean, I'm a little confused.

My impression (which may be wrong) was that refractions get calculated based on the geometry surface (which can also be affected by a bump map), not based on the shader/texture. So I was surprised to read that Anthony is trying to have a single surface refract itself, using a layered shader.

I did a few tests--admittedly on an older version of Maya--and it does seem to me that the refracting blinn portion of a layered shader refracts right through the surface. I think this is to be expected; I believe the different layers in a layered shader get calculated one at a time, and only the results get combined. So while the refracting layer is being calculated, it isn't 'aware' of the paint layer, and the traced rays pass right through.

To put it another way, trying to use a layered shader to get a single surface to refract itself would imply trying to make one bit of the surface be in two places at once: the elevated position of the water droplet, and the base position of the paint job. I don't think that raytracers think that way!

For true 3D refractions of water droplets, my guess is you'll need to duplicate your car surface and assign the refracting shader to that, leaving just the paint shader on the original.

Again, I'm not certain about this: if Anthony's method is actually a tried-and-true one, then I'm obviously out of the loop. (So what else is new? :) )

-Steve


Return to posts index


Sean Fennell
Re: mental ray + layered shaders - problems with refraction through entire surface
on Nov 15, 2005 at 10:17:12 pm

Yeah that sounds about right. I wasn't in the right mindset when I answered. Too busy at work you know. Anthony, if your surface is nurbs you can use the surface offset tool to give yourself a tiny bit of clearance between the wet layer and the car geometry. If its polygon, you should be able to just duplicate it and then move the points along their normals a tiny bit.

Steve is right, multiple geometry is essential for proper refractions because a surface cannot refract one side of itself through the same side of itself.


Return to posts index

anthonymcgrath
Re: mental ray + layered shaders - problems with refraction through entire surface
on Nov 16, 2005 at 12:52:21 pm

Sean, Steve thanks for looking into this. Steve - your completely on the nose with your test and mental ray looking right through the surface thats exactly what I'm getting.
Sean - I think your right I may have to create a copy of the surface and assign my raindroplets-blinn shader to that.

my other method of course is to fire out two passes - one beauty, one of the rain droplets. I then used the CCGlass tool in afx to get some subtle distortion - heres what I got which works okay for a mid close up...

Image hosted by Photobucket.com

and heres the two passes for afx...

Image hosted by Photobucket.com

Image hosted by Photobucket.com

need to rework my method for the real close up where I want to see the water run along the paintwork surface before the camera pulls out and along the bodywork - might have to do this on a different mesh setup (ie: one mesh with the water droplets blinn and the other with the car paint so I get true refractions) add the same camera move then use afx to match up and composite - I like compositing :D



Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]