From this paper that came out a few days ago, and comes with sample code:
Importance Sampling Microfacet-Based BSDFs using the Distribution of Visible Normals.
E. Heitz and E. d'Eon, EGSR 2014
http://hal.inria.fr/hal-00996995/en
Notes:
- Still many optimizations and cleanups needed, this is just a proof of concept.
- Sampling function uses erf, eval uses approximation to compute D, should be made consistent. Importance sampling using the approximation may be faster.
- erf_inv was copied from boost to avoid a compile error because we compile without RTTI. Also this function seems not available in OpenCL. We may end up not needing it if we can use the approximation for sampling.
- Their sample code (though not this patch) supports anisotropic Beckmann and GGX, will be nice to not need a different distribution for that.



















