Tuesday, April 24, 2012

Monte Carlo Subsurface Scattering

Monte Carlo subsurface scattering.
Last week I added Monte Carlo subsurface scattering to Photorealizer. I'll post more details for soon, but for now here's a quick and rough overview and some cool pictures.

I implemented the Henyey-Greenstein phase function for anisotropic scattering. I added volumetric texture support via ray marching. For now, I assume the scattering coefficient doesn't vary significantly by wavelength or in space, so I can trace all wavelengths together, and, in the case of volumetric textures, ray march to find the absorption after finding the next intersection or scattering point.

Monte Carlo subsurface scattering is very realistic and physically-based, which is why I like it. Monte Carlo subsurface scattering is very slow compared to approximation algorithms, but unlike most approximation algorithms it has no memory overhead and doesn't require a pre-pass. That said, it's actually not as slow as I expected, and could be fairly practical for rendering materials that aren't highly scattering.

I'll be able to extend this system to implement single scattering to go along with my diffusion-based multiple scattering. And I'll be able to use it as a reference, for visual validation of approximation algorithms.

All the images here were rendered in 720p resolution. Click them to view them at full size.

High scattering coefficient. Moderately forward scattering. Procedural volumetric texture. Because of the high scattering coefficient, most of the light doesn't get very far past the surface, and the look approaches that of a diffuse BRDF.

Scattering coefficient set to 1/4 of that in the first blue bunny image above, and other parameters held constant. As the average scattering distance increases, light on average propagates deeper into the material and more of it is absorbed, resulting in lower overall radiance and higher saturation. You can also see that more light is transmitted all the way through thin sections like the ears.

Scattering coefficient set to 1/64 of that in the first blue bunny image, and other parameters held constant. The trends observed in the previous image continue.

Compared to the first blue bunny image, this one uses a lower scattering coefficient (1/32 of the first blue bunny), as well as a lower absorption coefficient (1/8 of the first blue bunny), and a higher mean cosine of the scattering angle (more strongly forward scattering).
To me, while not intentional, the first two of these blue bunnies resemble toothpaste, but with higher index of refraction. The second one looked very much like that glittery kind of toothpaste when it was still very noisy, before it had converged very far.

1 comment: