AcademySoftwareFoundation / OpenPBR

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

Clarify details of fuzz model #106

Closed portsmouth closed 11 months ago

portsmouth commented 11 months ago

I've refactored the fuzz model discussion to be much more explicit about the specific model we recommend, i.e. the model presented in:

"Practical Multiple-Scattering Sheen Using Linearly Transformed Cosines", Zeltner et. al 2022.

I think I give enough detail to be able to easily make the correspondence between our parameters and the paper and reference implementation. This model I think is also much more physically appealing than the Conty-Kulla one, as it directly models a volumetric layer of microflakes, albeit using a simplified model which is fit to simulations of this.

Is is a little scary recommending a model which we have not ourselves implemented/tested though, but I'd suggest we just be bold and recommend it, then implement it ASAP and make adjustments as needed.

image

jstone-lucasfilm commented 11 months ago

@portsmouth Although I strongly support the idea of specifying a canonical fuzz model in OpenPBR, I'll note that we don't need to specify an untested model, and have the option of selecting the tried-and-true Kulla/Conty model for this initial revision, leaving it to future OpenPBR revisions to update to the more modern Zeltner/Burley model.

I don't have a strong preference on which model we choose for OpenPBR, but it seems important that it be well tested, both in production renderers and in the hands of a broad group of artists.

portsmouth commented 11 months ago

I would prefer to use the Zeltner-Burley-Chiang model, as it matches an explicit simulation of a material consisting of fibers. The Conty-Kulla model appears to produce a dimmer backscattering rim and almost no forward scattering.

Also their model has a clearer physical interpretation, as it was designed to match a simulation of light scattering from (and transmitting through) a thin layer of non-absorbing microflakes. Whereas the Conty-Kulla model is more ad-hoc and it's not clear exactly what it is modeling, so it's also physically unclear how it should be layered. (Not really a practical problem of course, but unappealing to someone interested in physically correct light transport).

I think there's very little risk in choosing this as the recommended model, and probably it's better for users (i.e. more realistic and expressive). That said, of course I'll be more comfortable once we have an implementation to try.

We are also introducing new models in others area (the new SSS parametrization, the new diffuse transmission, the more physical Fresnel dependence on IOR, the new anisotropy parametrization), so a lot of things are not well tested, or tested at all. I'm not worried though since all of these changes were thought about a lot, and designed to be more physically correct or expressive. If on testing we find there's some genuine issue with any of these things, we can obviously adjust as needed.

peterkutz commented 11 months ago

This looks good to me based on a first readthrough. Thanks for making these additions and changes to the spec.

I had started implementing the Zeltner-Burley-Chiang model a couple weeks ago and might still try to finish the implementation before next week's code freeze. It shouldn't be too hard to prototype considering that the authors provide a self-contained reference implementation.

portsmouth commented 11 months ago

I had started implementing the Zeltner-Burley-Chiang model a couple weeks ago and might still try to finish the implementation before next week's code freeze. It shouldn't be too hard to prototype considering that the authors provide a self-contained reference implementation.

Yep their reference implementation is very clear.

Note that in my description in the spec, I had to think a bit about whether to use $\omega_i$ or $\omega_o$ in the formulas. In their paper for example, the output direction cosine appears on the left (so one needs to integrate over output cosine to get a directional albedo). But in the usual interpretation in a renderer, "output" means output photon, so it's the input cosine that is being integrated over and sampled (as the output photon angle is known when proceeding from the camera direction). I've seen it on a t-shirt, so it must be correct 😛:

image

In their reference implementation though, they seem to use the standard approach, which is like the formula I wrote in the spec. The directional albedo I write as a function of known output angle, as elsewhere in the spec.

(We are a bit hazy in the spec currently about the meaning of $\omega_i$, $\omega_o$ and which is being sampled given the other etc.).

I also tried to write down the full details with the matrices and LTC transformation etc., but it looks a bit too complicated. It seems unnecessary to give that detail though, we only need to give enough to make it unambiguous how to implement given the parameters in our spec and the details given in the paper.