AcademySoftwareFoundation / OpenPBR

Specification and reference implementation for the OpenPBR Surface shading model

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Handling of raytraced subsurface entry/exit bounces

lukasstockner opened this issue · comments

When implementing raytraced subsurface scattering, the look of the material can vary significantly based on how the entry/exit bounce at the layer interface is handled.

The draft spec currently doesn't explicitly mention how this is to be handled, but there are some references, e.g. mentioning that the albedo mapping may depend on the interface IOR.

Is this something that should be specified, or is it to be left as an implementation detail?

The approaches that I am aware of are:

  • Perform a diffuse lambertian bounce at entry and exit: Easy to implement, but no particularly realistic and prone to overly white edges (since a significant fraction of rays will immediately hit the adjacent face and exit without ever scattering, regardless of incoming angle).
  • Refract through the interface according to the microfacet distribution at entry and exit: Arguably the most correct approach, but has practical downsides - additional storage for the microfacet parameters is needed, multiple bounces might be needed due to TIR, the BSSRDF no longer converges to a lambertian BSDF for radius->0.
  • Refract through the interface at the entry bounce, perform lambertian exit bounce: Provides most of the visual benefits of the full refraction approach while avoiding the downsides listed above.

Additionally, there is the question whether IOR and roughness values should be reused from the specular reflection lobe or specified separately.

Personally, if this is to be specified, I'd argue in favor of the "refractive entry, lambertian exit, reuse specular interface parameters" approach.

I worry that it could be hard to come up with a specific policy for this that is acceptable as each renderer may prefer to use different approximations.

The most physically correct approach would be to refract on entry and exit, but even then it's unclear how one would deal with a spatially varying IOR/volume (maybe just assume the medium is homogeneous as defined by the entry point? But that seems unrealistic).

Using a Lambertian lobe at entry/exit is appealing for simplicity and reducing caustic noise, but produces the artifacts you mentioned, and it just seems rather ad-hoc.

It could be a bit beyond the scope of the spec to try to nail down these details.

We could probably add a sentence or two to the spec, to make it clear at least that we leave the interpretation of this to the renderer.