AcademySoftwareFoundation / OpenPBR

Specification and reference implementation for the OpenPBR Surface shading model
Apache License 2.0
425 stars 18 forks source link

Handling of raytraced subsurface entry/exit bounces #80

Open lukasstockner opened 1 year ago

lukasstockner commented 1 year ago

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:

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.

portsmouth commented 1 year ago

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.

portsmouth commented 6 months ago

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.