Friday, May 30, 2008

Subtractive Reflection Pass Method

My first new tutorial since moving from a website to a blog! This calls for a celebration! Is 10 a.m. too early for a beer?
I was on a project with a pretty ridiculous deadline for the amount of work to be done, and of course, a ton of time was wasted trying to get approvals from the clients. After searching around for a good way to make a reflection pass, I found myself S.O.L. The best methods I found still involved a lot of setup, and hardly seemed worth the effort in the end. The worst part is, I had done a shot that was similar to what I was trying to do, but I couldn't remember how I had done the reflections. At the time, I had been running on no sleep for 2 days, so it's easy to see how I might forget anything I did. Then, suddenly, it happened. I remembered!! Subtractive Reflection Pass! At least that's what I call it. Basically, I render the scene with an approximation of the lighting, and turn on raytracing and specularity. Then, I render it again and turn off raytracing and specularity, and subtract one render from the other in After Effects.
Here's how it goes. We'll use a simple scene to illustrate. I'm going to use Photoshop, but it works the same in After Effects.

First render the scene with all the reflections and specularity you want.



Next, turn off reflections and specularity and render again.



Layer one render over the other, and change your blending mode to difference



And this is what you're left with.



And you can see, yes there are some drawbacks to this method. Namely, the areas where the reflection clips to white on a white object, such as in the checkerboard area. However, this usually isn't a real problem, and if it is, you can always change the objects color to a darker color to help avoid this. I have yet to try it with a floating point format, like HDR or EXR, but I think it might be worth looking into.

So now you have a separate reflection pass for use in your comps. I just recently used this technique on an ad for a Speed Racer happy meal tie-in. It was a huge time saver!