Skip to content

Commit 3435676

Browse files
authored
Support emissive strength in Standard Surface to glTF PBR (AcademySoftwareFoundation#2593)
closes: AcademySoftwareFoundation#2584 Instead of multiplying the emissive color (factor) and the emission (strength) in the translation graph, we now pass them through to the `gltf_shader`, which do the multiplication, since [KHR_materials_emissive_strength](https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Khronos/KHR_materials_emissive_strength) is implemented in `gltf_pbr`. The main difference in the current implementation between standard surface and gltf_pbr for emission is that standard surface takes the coat into consideration ([as emission is below the coat layer](https://autodesk.github.io/standard-surface/#closures/emission)). The gltf spec also layers emission below the coat, however not implemented in `gltf_pbr` currently, more info in issue: AcademySoftwareFoundation#2592. Even if the coat interaction differs a bit, I think we can just pass the emission and emission color through as both the shading models otherwise have the same implementation.
1 parent b48cb28 commit 3435676

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

libraries/bxdf/translation/standard_surface_to_gltf_pbr.mtlx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
<output name="clearcoat_out" type="float" />
3636
<output name="clearcoat_roughness_out" type="float" />
3737
<output name="emissive_out" type="color3" />
38+
<output name="emissive_strength_out" type="float" />
3839
</nodedef>
3940

4041
<nodegraph name="NG_standard_surface_to_gltf_pbr" nodedef="ND_standard_surface_to_gltf_pbr">
@@ -188,10 +189,12 @@
188189
</dot>
189190

190191
<!-- Emission -->
191-
<multiply name="emissive" type="color3">
192-
<input name="in1" type="color3" interfacename="emission_color" />
193-
<input name="in2" type="float" interfacename="emission" />
194-
</multiply>
192+
<dot name="emissive" type="color3">
193+
<input name="in" type="color3" interfacename="emission_color" />
194+
</dot>
195+
<dot name="emissive_strength" type="float">
196+
<input name="in" type="float" interfacename="emission" />
197+
</dot>
195198

196199
<!-- Specular Index of Refraction -->
197200
<dot name="ior" type="float">
@@ -212,6 +215,7 @@
212215
<output name="clearcoat_out" type="float" nodename="clearcoat" />
213216
<output name="clearcoat_roughness_out" type="float" nodename="clearcoat_roughness" />
214217
<output name="emissive_out" type="color3" nodename="emissive" />
218+
<output name="emissive_strength_out" type="float" nodename="emissive_strength" />
215219

216220
</nodegraph>
217221
</materialx>

0 commit comments

Comments
 (0)