Sunday, March 14, 2010

Ambient Occlusion in Flame

I had a joke between my assistants after one of them wrote me a spark that was a mux node only faster (which begs the question, why is a mux node slowing ANYTHING down?) that by the end of this year I want to see something that makes ambient occlusion (AO) in flame.

Then I started to read up (only in the most vague sense, because the math is very heavy) on Nvidia white papers about AO, the logic being that if the most expensive Nvidia graphics card can do AO, flame should be capable on some level.

Granted it has to be written into the software, which it clearly isn't since flame's 3d handling was written a while ago, and while it's super useful for compositing, it doesn't offer anything that your modern hardware graphics do (ray tracing, AO, shadows, self-shadows, soft shadows, etc...)

But it got me thinking about how to accomplish it. After experimenting for a bit using depth mattes and normal mattes (both easy to make in flame) based on one of these whitepapers where I recognized a few key words and got noplace special, and now I'm trying another likely failure with a light dome. The light dome got me thinking about the light domes of old, which are pretty much an AO cheat, mixing 30 or so shadow passes arrayed in a globe.

This too, would not work in flame: no shadow rendering. Then I thought of a cheat, which I think will work, but I'm writing this before I test it out. If you put cameras in your main scene, and orient them with the same spread as lights, you can render out objects that you want to cast shadows, then use the mattes, coming into a later comp via projectors that match said cameras and linked to the things to cast said shadow onto and this should give you a working 3d shadow. Do this thirty times with a lot of linking expressions, and in theory it should give you AO. I'm a bit worried about how the self-shadowing is going to work, but we'll see.

No comments:

Post a Comment