← All ideas
  • Published 26 Aug 2019

Proposed Modified Lambertian Reflectance for realistic SSS

Originally posted here but not sure if that was the right place: blenderartists.org/t/cycles-proposing-modified-lambertian-reflectance-for-realistic-sub-surface-scattering-sss/1176861

Image

Hi Everybody,

Not sure if this is the right place for discussion here but none the less... I am CTO of inciprocal Inc. ( www.inciprocal.com ), we develop PBR scanning and real-time rendering tech for AR/VR, eCommerce, VFX and game industies.

And we are using Blender/Cycles internally as a part of asset validation pipeline to make sure our digital assets match photographic references under the same lighting conditions. Though the assets are relatively low-poly but the shading data enables us to reconstruct source images quite nicely.

However, one thing has been a big issues for a while is SSS (sub surface scattering) along with diffuse lighting model. The problem is that standard Lambertian reflectance that is used for Diffuse (classical N.L) just doesn't quite work. From looking at many many photo references under a lot of different lighting conditions whether it's punctual lighting sources of very small area or classical filmic 3-light setups using area lighting, the end result is always much flatter than it should be in reality for a very wide range of surfaces. Such as fruits, vegetables, ceramics, plastics.

Those have very strong SSS to them but even state of the art Random Walk fails to match the reality. For rougher surfaces there is more advanced Oren-Nayar that works reasonably well but for those that I mentioned it's not the case. Regular N.L is too flat. And it's not a property of a surface but rather a solid/volume (you name it).

Not just Cycles.

We used various hacks using toon shading to approximate a better diffuse distribution but because toon is not designed for physically based rendering it's not energy conserving and samples the cone uniformly, you can't really MIX it and have to ADD the nodes. And it's very easy to blow up the render and still have the artifacts.

We've been using proposed (Modified Lambertian Reflectance) which is basically a pow(N.L, exponent) with energy conserving factor (1 + exponent) / 2. It's very similar to classical phong specular reflectance except it's N.L instead of R.L thus it's view independent. What we found that in reality, surfaces that I mentioned have this exponent somewhere in range between 1 and 2 with 1.5 being the average more or less.

For the lack of better name we just added "Exponent" parameter to all notes that deal with diffuse reflectance and transmittance. Yes, the same observation seems to apply to transmittance as well. So we use it for Diffuse, Transmittance as well as SSS nodes.

In case of SSS and RandomWalk, it similar to transmittance. That is the surface is sampled inwards with respect to diffuse BSDF. One nice things about this exponential N.L is that there is analytical solution for sampling and pdf calculation. Uses some trigonometry but there doesn't seem to be any noticeable performance impact. So we just use it though we call it conditionally if Exponent not equal 1.0. Exponent is limited between 0.5 and 2.0 by default but you can crank that value very high and enter non photo realistic rendering realm.

Also, we've been thinking about making this Exponent parameter being consistent with standard Roughness, but as I said before, it's not quite a property of the surface. As least not directly. So not sure what a better name it would be.

One thing for sure, if you are after realistic rendering of SSS materials, you need this type of diffuse modification one way of the other. Nice thing about this exponential solution is that it's fast even for real-time rendering (pow(a, b) is about 3 instruction on modern GPUs) and could be beneficial for EEVEE as well without performance impacts.

Here is our cycles patch: inciprocal.com/dev/blender/cycles/0001-Modified-Lambertian-SSS-implementation.patch for the devs to have a more definite idea of what's going on there but there is some missing functionality. No socket connects are supported (just some nodes) and no support in the principled shader there.

P.S. If you know who this thread should be referred to, let me know.

These are just some examples of real-photos vs low-poly scanned geometry/materials and Cycles renders.

Image Image Image Image Image

You can find these thru social media links over at inciprocal.com

Thank you,

  • Dmitry Andreev (President & CTO & inciprocal Inc.)

plastic_shading-fluttershy_02.jpg

0%

Development Status: Open

Upvote 0 Downvote 0
andcoder
26 Aug 2019

0 Comments