Skip to content

Commit c4f76c0

Browse files
committed
Add clamp of metal Fresnel to allow for specular_weight > 1 (AcademySoftwareFoundation#238)
Rather than eliminating the `specular_weight` > 1 case (as proposed in AcademySoftwareFoundation#228), we discussed keeping this but fixing up the metal logic to ensure the Fresnel remains bounded. This makes the corresponding change needed in the spec. (Note that now the `specular_weight` parameter consistently, for both metal and dielectric, has soft-range $[0,1]$ and full range $[0, \infty]$). It would be good to double check that the behaviour of the metal looks reasonable for high `specular_weight` values (presumably, similar to the dielectric where the Fresnel saturates).
1 parent 991c2e8 commit c4f76c0

1 file changed

Lines changed: 14 additions & 11 deletions

File tree

index.html

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -548,21 +548,22 @@
548548
\begin{equation}
549549
\mathbf{F}(\bar{\mu}) = \mathtt{specular\_color} * \mathbf{F}_\mathrm{Schlick}(\bar{\mu}) \ .
550550
\end{equation}
551-
The final metallic Fresnel term we employ is then given by an overall multiplication by **`specular_weight`**, ensuring that entire metallic lobe is suppressed as the weight goes to zero:
551+
552+
The final metallic Fresnel term we employ is then given by an overall multiplication by $\xi_s = \mathtt{specular\_weight}$, ensuring that the entire metallic lobe is suppressed as the weight goes to zero. Similarly to the dielectric, the weight may also exceed one in order to linearly boost the Fresnel, with a clamp put in place to ensure that it remains bounded in $[0,1]$ as $\xi_s \rightarrow \infty$: [^component_wise]
552553
\begin{equation}
553-
\mathbf{F}_{\mathrm{metal}}(\mu) = \mathtt{specular\_weight} * \mathbf{F}_{82}(\mu) \ .
554+
\mathbf{F}_{\mathrm{metal}}(\mu) = \mathrm{min}\bigl(1, \,\xi_s \mathbf{F}_{82}(\mu)\bigr) \ .
554555
\end{equation}
555556
This formulation has the useful property that it reduces to the regular Schlick reflectivity at the default values of **`specular_weight`** and **`specular_color`**.
556557
Note that the edge cannot be brighter than the standard Schlick term, but this is generally true in real metals. We consider this a benefit of this parametrization, as it makes it impossible to produce physically implausible metals with excessively bright edges.
557558

558-
Metal params | Label | Type | Range | Default | Description
559-
------------------------------------|------------|----------|:------------:|:-------------------:|----------------------------------------------
560-
**`base_weight`** | Weight | `float` | $ [0, 1] $ | $ 1 $ | Scalar multiplier to **`base_color`**
561-
**`base_color`** | Color | `color3` | $ [0, 1]^3 $ | $ (0.8, 0.8, 0.8) $ | Color of Fresnel reflection albedo at normal incidence, $\mathbf{F}_0$
562-
**`specular_weight`** | Weight | `float` | $ [0, 1] $ | $ 1 $ | Overall multiplier of the metallic Fresnel
563-
**`specular_color`** | Color | `color3` | $ [0, 1]^3 $ | $ (1, 1, 1) $ | Tint color of metallic Fresnel reflection albedo at near-grazing incidence (i.e. around silhouettes)
564-
**`specular_roughness`** | Roughness | `float` | $ [0, 1] $ | $ 0.3 $ | Roughness of NDF of conductor BRDF $f_\mathrm{conductor}$
565-
**`specular_roughness_anisotropy`** | Anisotropy | `float` | $ [0, 1] $ | $ 0 $ | Anisotropy of NDF of conductor BRDF $f_\mathrm{conductor}$
559+
Metal params | Label | Type | Range | Norm | Default | Description
560+
------------------------------------|------------|----------|:---------------:|:-------------:|:-------------------:|----------------------------------------------
561+
**`base_weight`** | Weight | `float` | $ [0, 1] $ | | $ 1 $ | Scalar multiplier to **`base_color`**
562+
**`base_color`** | Color | `color3` | $ [0, 1]^3 $ | | $ (0.8, 0.8, 0.8) $ | Color of Fresnel reflection albedo at normal incidence, $\mathbf{F}_0$
563+
**`specular_weight`** | Weight | `float` | $ [0, \infty) $ | $ [0, 1] $ | $ 1 $ | Overall multiplier of the metal Fresnel
564+
**`specular_color`** | Color | `color3` | $ [0, 1]^3 $ | | $ (1, 1, 1) $ | Tint color of metallic Fresnel reflection albedo at near-grazing incidence (i.e. around silhouettes)
565+
**`specular_roughness`** | Roughness | `float` | $ [0, 1] $ | | $ 0.3 $ | Roughness of NDF of BRDF $f_\mathrm{conductor}$
566+
**`specular_roughness_anisotropy`** | Anisotropy | `float` | $ [0, 1] $ | | $ 0 $ | Anisotropy of NDF of BRDF $f_\mathrm{conductor}$
566567

567568

568569
![](images/metal_with_default_edge_tint.png width=90% align=right) ![](images/metal_with_correct_edge_tint.png width=90% align=left)
@@ -788,7 +789,7 @@
788789
\begin{equation}
789790
\boldsymbol{\mu}_a = \boldsymbol{\mu}_t - \boldsymbol{\mu}_s \ .
790791
\end{equation}
791-
If any component of $\boldsymbol{\mu}_a$ is negative, then $\boldsymbol{\mu}_a$ is shifted by enough gray to make all the components positive, i.e. (in an obvious notation):
792+
If any component of $\boldsymbol{\mu}_a$ is negative, then $\boldsymbol{\mu}_a$ is shifted by enough gray to make all the components positive, i.e.: [^component_wise]
792793
\begin{eqnarray}
793794
&& \mathrm{if \;\; min(\boldsymbol{\mu}_a)} < 0 \nonumber \\
794795
&& \quad\quad \boldsymbol{\mu}_a \leftarrow \boldsymbol{\mu}_a - \mathrm{min}(\boldsymbol{\mu}_a) \ .
@@ -1621,6 +1622,8 @@
16211622

16221623
[^anisotropy_g]: Technically, $g$ is the _mean cosine of deflection_ of the phase function, which is not specific to the Henyey--Greenstein phase function model [#d'Eon2021].
16231624

1625+
[^component_wise]: Note that in this concise notation, the scalar denotes a constant vector.
1626+
16241627
[^Oren_Nayar_formula]: The $s$ term is given by (with normal $\mathbf{n}$):
16251628
\begin{eqnarray*}
16261629
s = \omega_i \cdot \omega_o - (\mathbf{n} \cdot \omega_i) (\mathbf{n} \cdot \omega_o) \nonumber = \cos(\phi_i-\phi_o) \,\sin\theta_i \,\sin\theta_o

0 commit comments

Comments
 (0)