Skip to content

Commit 878a7e6

Browse files
authored
Add clamp of metal Fresnel to allow for specular_weight > 1 (#238)
Rather than eliminating the `specular_weight` > 1 case (as proposed in #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 297d447 commit 878a7e6

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
@@ -552,21 +552,22 @@
552552
\begin{equation}
553553
\mathbf{F}(\bar{\mu}) = \mathtt{specular\_color} * \mathbf{F}_\mathrm{Schlick}(\bar{\mu}) \ .
554554
\end{equation}
555-
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:
555+
556+
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]
556557
\begin{equation}
557-
\mathbf{F}_{\mathrm{metal}}(\mu) = \mathtt{specular\_weight} * \mathbf{F}_{82}(\mu) \ .
558+
\mathbf{F}_{\mathrm{metal}}(\mu) = \mathrm{min}\bigl(1, \,\xi_s \mathbf{F}_{82}(\mu)\bigr) \ .
558559
\end{equation}
559560
This formulation has the useful property that it reduces to the regular Schlick reflectivity at the default values of **`specular_weight`** and **`specular_color`**.
560561
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.
561562

562-
Metal params | Label | Type | Range | Default | Description
563-
------------------------------------|------------|----------|:------------:|:-------------------:|----------------------------------------------
564-
**`base_weight`** | Weight | `float` | $ [0, 1] $ | $ 1 $ | Scalar multiplier to **`base_color`**
565-
**`base_color`** | Color | `color3` | $ [0, 1]^3 $ | $ (0.8, 0.8, 0.8) $ | Color of Fresnel reflection albedo at normal incidence, $\mathbf{F}_0$
566-
**`specular_weight`** | Weight | `float` | $ [0, 1] $ | $ 1 $ | Overall multiplier of the metallic Fresnel
567-
**`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)
568-
**`specular_roughness`** | Roughness | `float` | $ [0, 1] $ | $ 0.3 $ | Roughness of NDF of conductor BRDF $f_\mathrm{conductor}$
569-
**`specular_roughness_anisotropy`** | Anisotropy | `float` | $ [0, 1] $ | $ 0 $ | Anisotropy of NDF of conductor BRDF $f_\mathrm{conductor}$
563+
Metal params | Label | Type | Range | Norm | Default | Description
564+
------------------------------------|------------|----------|:---------------:|:-------------:|:-------------------:|----------------------------------------------
565+
**`base_weight`** | Weight | `float` | $ [0, 1] $ | | $ 1 $ | Scalar multiplier to **`base_color`**
566+
**`base_color`** | Color | `color3` | $ [0, 1]^3 $ | | $ (0.8, 0.8, 0.8) $ | Color of Fresnel reflection albedo at normal incidence, $\mathbf{F}_0$
567+
**`specular_weight`** | Weight | `float` | $ [0, \infty) $ | $ [0, 1] $ | $ 1 $ | Overall multiplier of the metal Fresnel
568+
**`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)
569+
**`specular_roughness`** | Roughness | `float` | $ [0, 1] $ | | $ 0.3 $ | Roughness of NDF of BRDF $f_\mathrm{conductor}$
570+
**`specular_roughness_anisotropy`** | Anisotropy | `float` | $ [0, 1] $ | | $ 0 $ | Anisotropy of NDF of BRDF $f_\mathrm{conductor}$
570571

571572

572573
![](images/metal_with_default_edge_tint.png width=90% align=right) ![](images/metal_with_correct_edge_tint.png width=90% align=left)
@@ -792,7 +793,7 @@
792793
\begin{equation}
793794
\boldsymbol{\mu}_a = \boldsymbol{\mu}_t - \boldsymbol{\mu}_s \ .
794795
\end{equation}
795-
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):
796+
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]
796797
\begin{eqnarray}
797798
&& \mathrm{if \;\; min(\boldsymbol{\mu}_a)} < 0 \nonumber \\
798799
&& \quad\quad \boldsymbol{\mu}_a \leftarrow \boldsymbol{\mu}_a - \mathrm{min}(\boldsymbol{\mu}_a) \ .
@@ -1599,6 +1600,8 @@
15991600

16001601
[^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].
16011602

1603+
[^component_wise]: Note that in this concise notation, the scalar denotes a constant vector.
1604+
16021605
[^Oren_Nayar_formula]: The $s$ term is given by (with normal $\mathbf{n}$):
16031606
\begin{eqnarray*}
16041607
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)