Skip to content

Commit 991c2e8

Browse files
committed
Add emission_weight (AcademySoftwareFoundation#231)
Implements the change described in AcademySoftwareFoundation#229.
1 parent d31b287 commit 991c2e8

4 files changed

Lines changed: 18 additions & 10 deletions

File tree

examples/open_pbr_lightbulb.mtlx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
<input name="surfaceshader" type="surfaceshader" nodename="open_pbr_surface_surfaceshader" />
55
</surfacematerial>
66
<open_pbr_surface name="open_pbr_surface_surfaceshader" type="surfaceshader">
7+
<input name="emission_weight" type="float" value="1.0" />
78
<input name="emission_color" type="color3" value="1.000, 0.415, 0.099" />
89
<input name="emission_luminance" type="float" value="10000" />
910
</open_pbr_surface>

index.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1129,17 +1129,17 @@
11291129
* +-------------------------------------------------+ *
11301130
*******************************************************
11311131

1132-
The intensity of the EDF is controlled by a luminance and a color multiplier. The **`emission_luminance`** parameter controls the luminance the emissive layer would have when **`emission_color`** is set to (1, 1, 1) and in the absence of coat and fuzz. The **`emission_color`** acts as a multiplier, i.e. the HDR emission in the model color space is defined to have a color given by **`emission_color`** * **`emission_luminance`**, thus the resulting luminance may be less than the input parameter, or even zero if the **`emission_color`** is set to (0, 0, 0). Note that the **`emission_color`** components may exceed 1, in order to be able to plug in an HDR texture [^ingamut].
1132+
The intensity of the EDF is controlled by a luminance value with color and weight multipliers. The color and weight act as multipliers, i.e. the HDR emission in the model color space is defined to have a color given by **`emission_weight`** * **`emission_color`** * **`emission_luminance`**. The **`emission_luminance`** parameter thus refers to the luminance the emissive layer would have when the color is white and weight is 1, and in the absence of coat and fuzz. Thus the final resulting luminance may be less than the input parameter, or even zero if the color or weight are zeroed. Note that the **`emission_color`** components may exceed 1, in order to be able to plug in an HDR texture. [^ingamut]
11331133

11341134
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.
11351135

1136-
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.
1137-
1136+
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. (Note that if the renderer does not deal with photometric units internally, a scale factor may need to be applied to bring the emission into a sensible range).
11381137

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

11441144
![](images/emitting_lava.png width=90% align=left) ![](images/emission_under_coat.png width=90% align=right)
11451145
<div class="shifted-caption">
@@ -1610,7 +1610,7 @@
16101610

16111611
[^lerp]: Where $\mathrm{lerp}(a, b, t) \equiv (1 - t) a + tb$.
16121612

1613-
[^ingamut]: Note that we assume that all RGB colors are in-gamut, and that colors representing albedos have components in the $[0,1]$ range (otherwise RGB renderers do not produce sensible results). The `emission_color` however is the exception which is permitted to have arbitrarily large (positive) components, since it represents an arbitrary luminance.
1613+
[^ingamut]: Note that we assume that all RGB colors are in-gamut, and that colors representing albedos have components in the $[0,1]$ range (otherwise RGB renderers do not produce sensible results). The `emission_color` however is the exception which is permitted to have arbitrarily large (positive) components, since it represents an arbitrary luminance multiplier.
16141614

16151615
i.e. have components in the $[0,1]$ range in the
16161616
specified color space.

parametrization.md.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@
5858
| `fuzz_color` | Color | `color3` | $ [0, 1]^3 $ | | $ (1, 1, 1) $ | |
5959
| `fuzz_roughness` | Roughness | `float` | $ [0, 1] $ | | $ 0.5 $ | |
6060
| **Emission** |
61-
| `emission_luminance` | Luminance | `float` | $ [0, \infty) $ | $ [0, 1000] $ | $ 0 $ | nits |
61+
| `emission_weight` | Weight | `float` | $ [0, 1] $ | | $ 0 $ | |
62+
| `emission_luminance` | Luminance | `float` | $ [0, \infty) $ | $ [0, 1000] $ | $ 1000 $ | nits |
6263
| `emission_color` | Color | `color3` | $ [0, \infty)^3 $ | | $ (1, 1, 1) $ | |
6364
| **Thin-film** |
6465
| `thin_film_weight` | Weight | `float` | $ [0, 1] $ | | $ 0 $ | |

reference/open_pbr_surface.mtlx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@
7171
doc="The thickness of the thin-film layer on the base (in micrometers)." />
7272
<input name="thin_film_ior" type="float" value="1.4" uimin="0.0" uisoftmin="1.0" uisoftmax="3.0" uiname="Thin Film Index of Refraction" uifolder="Thin Film" uiadvanced="true"
7373
doc="The index of refraction of the thin-film." />
74+
<input name="emission_weight" type="float" value="0.0" uimin="0.0" uimax="1.0" uiname="Emission Weight" uifolder="Emission"
75+
doc="Emission weight luminance multiplier." />
7476
<input name="emission_luminance" type="float" value="0.0" uimin="0.0" uisoftmax="1000.0" uiname="Emission Luminance" uifolder="Emission"
7577
doc="The amount of emitted light, as a luminance in nits." />
7678
<input name="emission_color" type="color3" value="1, 1, 1" uimin="0,0,0" uimax="1,1,1" uiname="Emission Color" uifolder="Emission"
@@ -584,12 +586,16 @@
584586
<input name="in1" type="float" nodename="coat_ior_to_F0_sqrt" />
585587
<input name="in2" type="float" nodename="coat_ior_to_F0_sqrt" />
586588
</multiply>
587-
<multiply name="emission_weight" type="color3">
588-
<input name="in1" type="color3" interfacename="emission_color" />
589+
<multiply name="weighted_emission_luminance" type="float">
590+
<input name="in1" type="float" interfacename="emission_weight" />
589591
<input name="in2" type="float" interfacename="emission_luminance" />
590592
</multiply>
593+
<multiply name="emission_color_weight" type="color3">
594+
<input name="in1" type="color3" interfacename="emission_color" />
595+
<input name="in2" type="float" nodename="weighted_emission_luminance" />
596+
</multiply>
591597
<uniform_edf name="uncoated_emission_edf" type="EDF">
592-
<input name="color" type="color3" nodename="emission_weight" />
598+
<input name="color" type="color3" nodename="emission_color_weight" />
593599
</uniform_edf>
594600
<multiply name="coat_tinted_emission_edf" type="EDF">
595601
<input name="in1" type="EDF" nodename="uncoated_emission_edf" />

0 commit comments

Comments
 (0)