View Full Version : Multipass with refraction

04-12-2012, 04:33 AM
I basically have some objects orbiting a glass cube, the cube has some refraction. I just want to render out the orbiting objects including the distortions they make as they go behind the cube. Any tips how to turn off the cube so it's not present in the render but so the refraction is still influencing my orbiting pieces?

04-12-2012, 05:02 AM
Did you try Object Properties > Unseen by camera?

I am not sure whether it will work with refraction, but with reflection it worked fine:

take spot info > sampled ray, plug it to Math > Scalar > Invert, then plug to Transparency. Surface will be visible in reflection, but not visible from camera.

04-12-2012, 05:15 AM
Hi Sensei. That's a nice tip, I'll give it a whirl. I'm just at rough preVis stage for now and have found setting the glass cube's Properties/Render/Alpha Channel to Constant Black seems to give me what I need for now. The node approach sounds interesting, though.

04-12-2012, 05:46 AM
Actually, what I'm finding I need more is JUST the refracted objects behind the glass. Almost like inverting the glass cube's alpha and using it as a mask for the pieces behind it. How would I set that up?

04-13-2012, 10:56 AM
Did you sort this? I had to do a similar thing a few months ago, but I rendered out the objects in separate passes and then used mattes to knock out the objects that were travelling behind the glass objects (if that makes sense).

For what you're describing, it just sounds like you need to render one pass with your glass object (a) with alpha channel set to constant black, and your other object (b) set to 'Unseen by Camera'. Then a separate pass with your object (b) as normal but your glass object (a) 'Unseen by Camera'. Then a final pass with just your object (a) as a 'Matte Object'. This lets you subtract any parts of object (b) render that pass behind the glass from your composite.

04-13-2012, 11:27 AM
While you can't _just_ render that information, there's a refraction buffer available to save, which just contains the refracted parts of an image.


04-14-2012, 03:25 AM
Thanks all

@souzou, great minds! That's pretty much what I ended up doing. I also have AELink and it's turned out to be invaluable for syncing objects with mattes in AE, esp with simple 3d objects that I can quickly build in AE (or import an obj into AE - haven't tried that yet!).

@Lightwolf, great tip. It didn't occur to me to look at what the buffers were doing at this stage in the project. I think I'd have to clip out the foreground objects if I eventually wanted separate diffuse/spec etc on the refracted objects. I guess I could do that with a clip map but haven't tired it on Instances yet. I've noticed that there is no control for opacity on LW Instances (feature request?), at least not via Object Dissolve, so will have to test whether clip maps work.

Thanks for your inputs :)

04-14-2012, 04:14 AM
I would simply replace the cube's surface with 100% transparency and keep the ior (removing all other properties like specular, etc)
the other objects I would make them matte or with a 100% luminous surface

04-15-2012, 04:24 AM
Thanks zardoz, that makes sense but any idea how to clip out Instanced foreground elements with this technique? I can't get a Clip Map to work. The Refraction buffer is working really well for one pass, then another pass for the un-refracted pieces with the glass box set to Matte Object/Constant Black (masking out the refractions) and then a final pass of just the glass box. This method feels very long in the tooth! I wonder if DP Filter could help me out here to get everything in one or two passes and not have to break the scene apart for every pass? I don't think what I'm after is all that out of the ordinary!