Friday, April 20, 2012

First Images with Multiple Scattering

Early last week, I set aside a day and finished the core of my multiple scattering implementation, so I can now efficiently render translucent materials with subsurface scattering! With this I'll be able to render things like milk, tomatoes, grapes (I must be hungry), plastic, marble, and lots of other new things.

This is still a work in progress, with many related features and improvements left to implement (including single scattering, multicolored objects (I already support separate scattering parameters for the R, G, and B components), and a variety of little things), but I've structured everything with these things in mind, and now coding most of them should be relatively straightforward.

A lot went into this. Check out my previous couple posts for some background information, implementation details, and a list of resources I've used. To summarize, my multiple scattering implementation is primarily based on Jensen and Buhler's 2002 paper A Rapid Hierarchical Rendering Technique for Translucent Materials, with the help of many other resources as well (many of which I listed in a previous post). At some point, I'd like to post more implementation details and write about the specific challenges involved, such as designing a good architecture, storing separate point clouds for separate objects, making it compatible with other features like instancing and transformations, extending the model to multiple wavelengths, and identifying a couple errors and ambiguities in the paper.

Here's an image would be nearly impossible to render without a combination of approximate multiple scattering and environment map importance sampling:


That bunny has a perfectly smooth surface. I've also added support for rough surfaces:


Just as with my physically-based diffuse / specular model, what's reflected specularly from the surface is not available to take part in subsurface scattering, so the system conserves energy.

And for reference, here's a quick render of an opaque bunny (not exactly the same color) in the same place:


As you can tell, the scattering bunnies above are highly translucent compared to this one.

1 comment: