Wednesday, May 9, 2012

Rough Transmission Update

I rendered a few high quality images using the microfacet model for transmission that I implemented recently. First, here's a smooth glass version for comparison:

Smooth glass.

Next, here's an image showing ground glass using the Beckman distribution:

Ground glass using the Beckman microfacet distribution.

And finally, here's an image showing ground glass using the GGX distribution:

Ground glass using the GGX microfacet distribution.

I do like the look of the GGX distribution, but it has a few issues. It looks very good overall, but it's somewhat dark, because the GGX distribution has more shadowing and masking at this high roughness.

Another issue is that there are some fireflies (really bright spots), which are only occuring with GGX, but not Beckman. I have a feeling the fireflies could be due to very large sample weights that occur in rare cases, but I haven't looked into it deeply yet.

The paper ("Microfacet Models for Refraction through Rough Surfaces") mentions that sample weights can get huge at grazing angles (when i is close to perpendicular to n). They suggest widening the distribution width at grazing angles and provide math that works well for the Beckman distribution, which I'm currently also using for GGX, but I might need to tweak that math for GGX.

It also looks like the sample weight would get very large if the sampled microsurface normal is close to perpendicular to the macrosurface normal, and that seems to be much more likely with the GGX distribution because of its wider tails. So I should look into that as well.


  1. I experimented with GGX a while back, so it's a little rusty for me, but I think when I used "h dot l" instead of "n dot l" for fresnel that all the sparkles in GGX went away for me. (h = half-way vector, l = light vector, n = normal)

    At least *I think* it was the fresnel term.
    I know for sure I replaced an n with a h though (sorry for being vague, like I said, it's been a while since I looked at it)

    1. Thanks for the comments and insight Sander!

      I checked and I'm already using the halfway vector (or the microfacet normal in the case of BSDF sampling) for Fresnel, so that in particular doesn't seem to be the issue in this case, but I'll look around and see if there are any other places where it might make sense to use the halfway vector instead of the surface normal.

      It's also likely that the sparkles are a result of very large sample weights that occur in rare cases, and I've updated the post to elaborate on this.

  2. And I forgot to mention that your results look amazing! Keep up the good work :)

  3. Hello Peter.
    Very good work.
    What are your roadmap? You're not thinking as an experiment to port your code example in maya? We can try. Please write me what you think about it.
    (goofoo dot tut dot by)