Skip to content

Commit 297d447

Browse files
authored
Add emission_weight (#231)
Implements the change described in #229.
1 parent 7112029 commit 297d447

4 files changed

Lines changed: 17 additions & 8 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: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1133,17 +1133,18 @@
11331133
* +-------------------------------------------------+ *
11341134
*******************************************************
11351135

1136-
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).
1136+
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.
11371137

11381138
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.
11391139

1140-
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.
1140+
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).
11411141

11421142

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

11481149
![](images/emitting_lava.png width=90% align=left) ![](images/emission_under_coat.png width=90% align=right)
11491150
<div class="shifted-caption">

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, 1]^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)