Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handling of raytraced subsurface entry/exit bounces #80

Open
lukasstockner opened this issue Aug 8, 2023 · 2 comments
Open

Handling of raytraced subsurface entry/exit bounces #80

lukasstockner opened this issue Aug 8, 2023 · 2 comments

Comments

@lukasstockner
Copy link

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.

@portsmouth
Copy link
Contributor

portsmouth commented Sep 4, 2023

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
Copy link
Contributor

portsmouth commented Feb 20, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants