AcademySoftwareFoundation / OpenPBR

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

Anisotropy parametrisation #82

Closed virtualzavie closed 3 months ago

virtualzavie commented 1 year ago

In the current draft of the spec, a few parametrisations references are mentioned, and we propose a new one. We are yet to confirm what parametrisation we want to use.

To help evaluate the models, here are some renders. The roughness goes from 0 on the left to 1 on the right, and the anisotropy goes from 0 at the top, to 1 at the bottom.

Burley 2012 (Disney model)

$$ \alpha_t = \frac{r^2}{\sqrt{1 - 0.9 a}}, \quad\alpha_b = r^2 \sqrt{1 - 0.9 a} $$

where $0.9$ is a value chosen to limit the aspect ratio of the specular highlight to $10:1$.

2023-08-16 anisotropy-mapping-Burley2012

Georgiev2019 (Standard Surface)

$$ \alpha_t = \mathrm{min}\bigl(\frac{r^2}{\sqrt{1-a}}, 1.0\bigr), \quad\alpha_b = r^2 \sqrt{1-a} $$

2023-08-16 anisotropy-mapping-Georgiev2019

Kulla 2017 (Sony Pictures Imageworks)

$$ \alpha_t = r^2 (1 + a), \quad\alpha_b = r^2 (1 - a) $$

2023-08-16 anisotropy-mapping-Kulla2017

Neubelt 2013 (The Order: 1886)

$$ \alpha_t = r^2, \quad\alpha_b = \mathrm{lerp}(0, r^2, 1 - a) $$

2023-08-16 anisotropy-mapping-Neubelt2013

Kutz2021 (Adobe Standard Material)

$$ \alpha_t = r^2 + a^4, \quad\alpha_b = r^2 $$

2023-08-16 anisotropy-mapping-Kutz2021

Current OpenPBR proposed mapping

$$ \alpha_t = r^2 \sqrt{\frac{2}{1 + (1 - a)^2}}, \quad\alpha_b = (1 - a) \, \alpha_t $$

2023-08-16 anisotropy-mapping-OpenPBR2023

virtualzavie commented 1 year ago

Some elements to consider:

Some materials to consider:

portsmouth commented 1 year ago

Thanks for the very informative renders @virtualzavie !

I'd note that all of the parametrizations except the Adobe one have the property that the surface is a mirror when roughness -> 0. I think that just makes the most sense both mathematically/physically and intuitively:

I do agree though with the point that it could potentially be confusing for an artist to dial the coat anisotropy, and see no effect by default since the roughness is zero. Perhaps we can mitigate that by making the default roughness of the coat some small but non-zero value (0.01?). Zero roughness is also problematic for light transport (e.g. point lights are then invisible), so it would be best for that to not be the default.

virtualzavie commented 11 months ago

Update: we are experimenting with introducing an empirical modification of the proposed model, to address the counter intuitive behaviour that when roughness is 0, the anisotropy parameter has no visible effect.

The modification consists in remapping the roughness as $r \gets \texttt{lerp}(r{min}, 1, r)$, so when anisotropy $a \gt 0$, roughness has a minimum value $r{min} = \epsilon . a$ different from zero, thus introducing a visual difference.

elalish commented 11 months ago

We discussed these same anisotropy parameterizations for the glTF anisotropy extension early this year and finally settled on one very close to Adobe Standard Material, only reducing the power, which Adobe agreed gave better perceptual linearity:

$α_t=r^2+a^2, \quad α_b=r^2$

The artist intuition here is that adding anisotropy is like scratching the surface - adding roughness in one direction. Therefore it has effect on smooth surfaces, but reaches a limit as base roughness is increased since no further roughness can be added to a completely matte material.

We also had long discussions about how to parameterize anisotropy within a texture - have you settled on a format for that yet? We finally decided on one that doesn't introduce strange wrapping or other interpolation artifacts from texture sampling.

portsmouth commented 7 months ago

@elalish

We considered that parametrization (i.e. the Adobe one), and overall we thought that it's problematic that the overall roughness should change as the anisotropy changes (diluting the meaning of the roughness parameter, and making it harder to dial in the average roughness first). Also we wanted to keep the effect as linear as possible in the 2d space, which the renders above indicate the OpenPBR mapping does a better job of.

This seems a hard one to get universal agreement, since there's an element of arbitrariness and taste. At least, whatever different models choose, you can map between them easily enough.

portsmouth commented 6 months ago

Can be closed as we've settled on a parametrization (apart from the flow-map issue of https://github.com/AcademySoftwareFoundation/OpenPBR/issues/155).

@virtualzavie feel free to close.