Skip to content

Commit

Permalink
Set soft range for unbounded values (#114)
Browse files Browse the repository at this point in the history
  • Loading branch information
virtualzavie authored Oct 13, 2023
1 parent 7e7916e commit 4c1ad1a
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 20 deletions.
29 changes: 16 additions & 13 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,7 @@

Superimposed on this is the reflection generated by scattering in the subsurface medium. In this case the subsurface medium $V^\infty_\mathrm{subsurface}$ is given a parametrization which is particularly convenient for controlling the volumetric effect of dense subsurface scattering:

- **`subsurface_radius`** * **`subsurface_radius_scale`**: the desired size of the "blur" on the surface per RGB channel, i.e. roughly the average distance that light travels _along the surface_ per-channel, $\mathbf{r}$, also termed the _diffusion radius_.
- **`subsurface_radius`** * **`subsurface_radius_scale`**: the desired size of the "blur" on the surface per RGB channel, i.e. roughly the average distance that light travels _along the surface_ per-channel, $\mathbf{r}$, also termed the _diffusion radius_. Being a length, **`subsurface_radius`** can be any value greater than or equal to zero. For convenience, we make the soft range $[0, 1]$, thus covering common cases.
- **`subsurface_color`**: the observed RGB reflection albedo color taking into account all orders of multiple scattering, $\mathbf{A}$, also termed the _multi-scatter albedo_.
- **`subsurface_anisotropy`**: the medium's phase function (assumed to be the standard Henyey-Greenstein form), parametrized by the scalar anisotropy $g \in [-1, 1]$.

Expand Down Expand Up @@ -685,13 +685,13 @@
Note that the default value of **`subsurface_radius_scale`** is set at $(1, 0.5, 0.25)$ to approximate the effect of Rayleigh scattering. If we roughly approximate the wavelength corresponding to each of the RGB channels as $\lambda/\mathrm{nm} \approx 650, 550, 450$ and assume the radii scale like the reciprocal of the extinction, then since in Rayleigh scattering the extinction scales like $\lambda^{-4}$ for light of wavelength $\lambda$ the expected relative magnitudes of the radii are $(1, (550/650)^4, (450/650)^4) \approx (1, 0.5, 0.25)$, hence the chosen default. This provides a slightly more realistic default look for the subsurface than resulting from gray radii.


Subsurface params | Label | Type | Range | Default | Description
------------------------------|--------------|-----------|:---------------:|:--------------------:|----------------------------------------------
**`subsurface_weight`** | Weight | `float` | $ [0, 1] $ | $ 0 $ | Mix weight between subsurface and diffuse slabs
**`subsurface_color`** | Color | `color3` | $ [0, 1] $ | $ (0.8, 0.8, 0.8) $ | Subsurface color, i.e. the multi-scatter albedo of $V^\infty_\mathrm{subsurface}$
**`subsurface_radius`** | Radius | `float` | $ [0, \infty) $ | $ 1 $ | Length scale of diffusion along the surface
**`subsurface_radius_scale`** | Radius scale | `vector3` | $ [0, 1]^3 $ | $ (1.0, 0.5, 0.25) $ | RGB multiplier to **`subsurface_radius`**, giving the per-channel diffusion length
**`subsurface_anisotropy`** | Anisotropy | `float` | $ [-1, 1] $ | $ 0 $ | Anisotropy of the Henyey-Greenstein phase function of the interior medium $V^\infty_\mathrm{subsurface}$
Subsurface params | Label | Type | Range | Norm | Default | Description
------------------------------|--------------|-----------|:---------------:|:----------:|:--------------------:|----------------------------------------------
**`subsurface_weight`** | Weight | `float` | $ [0, 1] $ | | $ 0 $ | Mix weight between subsurface and diffuse slabs
**`subsurface_color`** | Color | `color3` | $ [0, 1] $ | | $ (0.8, 0.8, 0.8) $ | Subsurface color, i.e. the multi-scatter albedo of $V^\infty_\mathrm{subsurface}$
**`subsurface_radius`** | Radius | `float` | $ [0, \infty) $ | $ [0, 1] $ | $ 1 $ | Length scale of diffusion along the surface
**`subsurface_radius_scale`** | Radius scale | `vector3` | $ [0, 1]^3 $ | | $ (1.0, 0.5, 0.25) $ | RGB multiplier to **`subsurface_radius`**, giving the per-channel diffusion length
**`subsurface_anisotropy`** | Anisotropy | `float` | $ [-1, 1] $ | | $ 0 $ | Anisotropy of the Henyey-Greenstein phase function of the interior medium $V^\infty_\mathrm{subsurface}$

![](images/subsurface1.jpg width=99%) ![](images/subsurface2.jpg width=99%) ![](images/subsurface3.jpg width=99%)
<div class="shifted-caption">
Expand All @@ -715,6 +715,7 @@
\begin{equation}
\boldsymbol{\mu}_t = - \frac{\ln \mathbf{T}} {\lambda} \ .
\end{equation}
Being a length, **`transmission_depth`** can be any value greater than or equal to zero. For convenience, we make the soft range $[0, 1]$, thus covering common cases.
However when **`transmission_depth`** $\lambda$ is zero, it is assumed that the interior medium is absent ($\boldsymbol{\mu}_t=0$) and **`transmission_color`** is used instead to non-physically tint the dielectric refraction Fresnel factor multiplicatively by a constant amount (ignoring the dielectric energy balance).

The **`transmission_scatter`** parameter $\mathbf{S}$ directly sets the medium scattering coefficient $\boldsymbol{\mu}_s$ (as a multiple of the inverse **`transmission_depth`**):
Expand Down Expand Up @@ -791,7 +792,7 @@
------------------------------------------|------------------|----------|:---------------:|:-----------:|:-------------:|----------------------------------------------
**`transmission_weight`** | Weight | `float` | $ [0, 1] $ | | $ 0 $ | Mix weight between translucent base and opaque base slabs
**`transmission_color`** | Color | `color3` | $ [0, 1]^3 $ | | $ (1, 1, 1) $ | Transmission color, specifies the extinction of $V^\infty_\mathrm{dielectric}$
**`transmission_depth`** | Depth | `float` | $ [0, \infty) $ | | $ 0 $ | Distance traveled inside the medium by white light before its color becomes exactly **`transmission_color`** by Beer's law, determining the extinction coefficient of the interior medium; if zero, **`transmission_color`** acts as a constant (on-surface) transmission tint
**`transmission_depth`** | Depth | `float` | $ [0, \infty) $ | $ [0, 1] $ | $ 0 $ | Distance traveled inside the medium by white light before its color becomes exactly **`transmission_color`** by Beer's law, determining the extinction coefficient of the interior medium; if zero, **`transmission_color`** acts as a constant (on-surface) transmission tint
**`transmission_scatter`** | Scatter | `color3` | $ [0, 1]^3 $ | | $ (0, 0, 0) $ | Scattering coefficient of the interior medium
**`transmission_scatter_anisotropy`** | Anisotropy | `float` | $ [-1, 1] $ | | $ 0 $ | Anisotropy of the Henyey-Greenstein phase function of the interior medium $V^\infty_\mathrm{dielectric}$
**`transmission_dispersion_abbe_number`** | Abbe number | `float` | $ [0, \infty) $ | $ [9, 91] $ | $ 20 $ | Abbe number of the medium, inversely proportional to how much the index of refraction varies across wavelengths when **`transmission_dispersion_scale`** is `1`; defaults to approximately the highest Abbe number of any real clear dielectric so that any realistic amount of dispersion can be achieved by varying **`transmission_dispersion_scale`** in $[0, 1]$
Expand Down Expand Up @@ -1022,14 +1023,16 @@

Moreover, the overall material luminance may be further reduced in the presence of coat or fuzz, as they can absorb light coming from the emissive layer before it exits the surface. The emission from the top surface should in principle gain a directional dependence due to the combined effects of absorption, total internal reflection (TIR) and multiple bounces in the coat layer, and absorption in the fuzz layer. The combined effect should result mostly in darkening and saturation at grazing angles.

Being an intensity, **`emission_luminance`** can be any value greater than or equal to zero. For convenience, we make the soft range $[0, 1000]$, corresponding to the typical range of home appliances.

!!! WARNING
The interaction of emission and fuzz should be specified, either here or preferably in the Fuzz section.
In addition, there probably needs to be a more detailed discussion of how the transmittance of the EDF through the coat and fuzz is computed.

Emission params | Label | Type | Range | Default | Description
-------------------------|-----------|----------|:---------------:|:-------------:|----------------------------------------------
**`emission_luminance`** | Luminance | `float` | $ [0, \infty) $ | $ 0 $ | Emission luminance, in cd/m^2 (aka. nits)
**`emission_color`** | Color | `color3` | $ [0, 1]^3 $ | $ (1, 1, 1) $ | Emission color multiplier
Emission params | Label | Type | Range | Norm | Default | Description
-------------------------|-----------|----------|:---------------:|:-------------:|:-------------:|----------------------------------------------
**`emission_luminance`** | Luminance | `float` | $ [0, \infty) $ | $ [0, 1000] $ | $ 0 $ | Emission luminance, in cd/m^2 (aka. nits)
**`emission_color`** | Color | `color3` | $ [0, 1]^3 $ | | $ (1, 1, 1) $ | Emission color multiplier

![](images/emitting_lava.png width=90% align=left) ![](images/emission_under_coat.png width=90% align=right)
<div class="shifted-caption">
Expand Down
8 changes: 4 additions & 4 deletions parametrization.md.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@
| **Transmission** |
| `transmission_weight` | Weight | `float` | $ [0, 1] $ | | $ 0 $ | |
| `transmission_color` | Color | `color3` | $ [0, 1]^3 $ | | $ (1, 1, 1) $ | |
| `transmission_depth` | Depth | `float` | $ [0, \infty) $ | | $ 0 $ | length |
| `transmission_depth` | Depth | `float` | $ [0, \infty) $ | $ [0, 1] $ | $ 0 $ | length |
| `transmission_scatter` | Scatter | `color3` | $ [0, 1]^3 $ | | $ (0, 0, 0) $ | |
| `transmission_scatter_anisotropy` | Anisotropy | `float` | $ [-1, 1] $ | | $ 0 $ | |
| `transmission_dispersion_abbe_number` | Abbe number | `float` | $ [0, \infty) $ | $ [9, 91] $ | $ 20 $ | |
| `transmission_dispersion_abbe_number` | Abbe number | `float` | $ (0, \infty) $ | $ [9, 91] $ | $ 20 $ | |
| `transmission_dispersion_scale` | Dispersion scale | `float` | $ [0, 1] $ | | $ 0 $ | |
| **Subsurface** |
| `subsurface_weight` | Weight | `float` | $ [0, 1] $ | | $ 0 $ | |
| `subsurface_color` | Color | `color3` | $ [0, 1] $ | | $ (0.8, 0.8, 0.8) $ | |
| `subsurface_radius` | Radius | `float` | $ [0, \infty) $ | | $ 1 $ | length |
| `subsurface_radius` | Radius | `float` | $ [0, \infty) $ | $ [0, 1] $ | $ 1 $ | length |
| `subsurface_radius_scale` | Radius scale | `vector3` | $ [0, 1]^3 $ | | $ (1.0, 0.5, 0.25) $ | |
| `subsurface_anisotropy` | Anisotropy | `float` | $ [-1, 1] $ | | $ 0 $ | |
| **Coat** |
Expand All @@ -61,7 +61,7 @@
| `fuzz_color` | Color | `color3` | $ [0, 1]^3 $ | | $ (1, 1, 1) $ | |
| `fuzz_roughness` | Roughness | `float` | $ [0, 1] $ | | $ 0.5 $ | |
| **Emission** |
| `emission_luminance` | Luminance | `float` | $ [0, \infty) $ | | $ 0 $ | nits |
| `emission_luminance` | Luminance | `float` | $ [0, \infty) $ | $ [0, 1000] $ | $ 0 $ | nits |
| `emission_color` | Color | `color3` | $ [0, 1]^3 $ | | $ (1, 1, 1) $ | |
| **Thin-film** |
| `thin_film_thickness` | Thickness | `float` | $ [0, \infty) $ | $ [0, 2000] $ | $ 0 $ | nanometers |
Expand Down
6 changes: 3 additions & 3 deletions reference/open_pbr_surface.mtlx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
doc="Mixture weight between the transparent and opaque dielectric base. The greater the value the more transparent the material." />
<input name="transmission_color" type="color3" value="1, 1, 1" uimin="0,0,0" uimax="1,1,1" uiname="Transmission Color" uifolder="Transmission" uiadvanced="true"
doc="Controls color of the transparent base due to Beer's law volumetric absorption under the surface (reverts to a non-physical tint when transmission_depth is zero)." />
<input name="transmission_depth" type="float" value="0.0" uimin="0.0" uisoftmax="100.0" uiname="Transmission Depth" uifolder="Transmission" uiadvanced="true"
<input name="transmission_depth" type="float" value="0.0" uimin="0.0" uisoftmax="1.0" uiname="Transmission Depth" uifolder="Transmission" uiadvanced="true"
doc="Specifies the distance light travels inside the transparent base before it becomes exactly the transmission_color according to Beer's law." />
<input name="transmission_scatter" type="color3" value="0, 0, 0" uimin="0,0,0" uimax="1,1,1" uiname="Transmission Scatter" uifolder="Transmission" uiadvanced="true"
doc="Controls the color of light volumetrically scattered inside the transparent base. Suitable for materials with visually significant scattering such as honey, fruit juice, murky water, opalescent glass, or milky glass." />
Expand All @@ -43,7 +43,7 @@
doc="Mixture weight which dials the opaque dielectric base between diffuse reflection and subsurface scattering. A value of 1.0 indicates full subsurface scattering and a value 0 for diffuse reflection only." />
<input name="subsurface_color" type="color3" value="0.8, 0.8, 0.8" uimin="0,0,0" uimax="1,1,1" uiname="Subsurface Color" uifolder="Subsurface" uiadvanced="true"
doc="The overall reflected color of the subsurface scattering effect." />
<input name="subsurface_radius" type="float" value="1.0" uimin="0.0" uisoftmax="10.0" uiname="Subsurface Radius" uifolder="Subsurface" uiadvanced="true"
<input name="subsurface_radius" type="float" value="1.0" uimin="0.0" uisoftmax="1.0" uiname="Subsurface Radius" uifolder="Subsurface" uiadvanced="true"
doc="Length scale of the subsurface diffusion blur profile on the surface." />
<input name="subsurface_radius_scale" type="color3" value="1.0, 0.5, 0.25" uimin="0,0,0" uimax="1,1,1" uiname="Subsurface Radius Scale" uifolder="Subsurface" uiadvanced="true"
doc="RGB multiplier to subsurface_radius, giving the per-channel diffusion blur profile size." />
Expand Down Expand Up @@ -73,7 +73,7 @@
doc="The thickness of the thin film layer on the base (in nanometers). Use for materials such as multi-tone car paint or soap bubbles." />
<input name="thin_film_ior" type="float" value="1.5" uimin="0.0" uisoftmin="1.0" uisoftmax="3.0" uiname="Thin Film Index of Refraction" uifolder="Thin Film" uiadvanced="true"
doc="The index of refraction of the thin-film." />
<input name="emission_luminance" type="float" value="0.0" uimin="0.0" uisoftmax="1.0" uiname="Emission Luminance" uifolder="Emission"
<input name="emission_luminance" type="float" value="0.0" uimin="0.0" uisoftmax="1000.0" uiname="Emission Luminance" uifolder="Emission"
doc="The amount of emitted light, as a luminance in nits." />
<input name="emission_color" type="color3" value="1, 1, 1" uimin="0,0,0" uimax="1,1,1" uiname="Emission Color" uifolder="Emission"
doc="The color of the emitted light." />
Expand Down

0 comments on commit 4c1ad1a

Please sign in to comment.