Skip to content

Commit 6f8b18b

Browse files
authored
Support Specular and Specular Color in Standard Surface to glTF PBR (AcademySoftwareFoundation#2623)
closes AcademySoftwareFoundation#2581 ## Summary This PR passthrough the specular weight and the specular color from standard surface to gltf_pbr. This translation will not produce completely matching result, even if specular and specular_color control similar aspects in both the shading models, there are some fundamental differences. It will successfully translate the specular weight, so if you have a material with roughness 0, and specular 0, it will be a diffuse material (similar to roughness 1). But the difference will be in the specular_color, both for dielectric materials (non-metals) and conductors (metals).
1 parent 4cc8155 commit 6f8b18b

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

libraries/bxdf/translation/standard_surface_to_gltf_pbr.mtlx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
<input name="base" type="float" value="1" />
66
<input name="base_color" type="color3" value="0.8, 0.8, 0.8" />
77
<input name="metalness" type="float" value="0" />
8+
<input name="specular" type="float" value="1" />
9+
<input name="specular_color" type="color3" value="1, 1, 1" />
810
<input name="specular_anisotropy" type="float" value="0.0" />
911
<input name="specular_rotation" type="float" value="0.0" />
1012
<input name="specular_roughness" type="float" value="0.2" />
@@ -27,6 +29,8 @@
2729
<output name="base_color_out" type="color3" />
2830
<output name="metallic_out" type="float" />
2931
<output name="roughness_out" type="float" />
32+
<output name="specular_out" type="float" />
33+
<output name="specular_color_out" type="color3" />
3034
<output name="ior_out" type="float" />
3135
<output name="anisotropy_strength_out" type="float" />
3236
<output name="anisotropy_rotation_out" type="float" />
@@ -203,6 +207,14 @@
203207
<input name="in" type="float" interfacename="emission" />
204208
</dot>
205209

210+
<!-- Specular -->
211+
<dot name="specular" type="float">
212+
<input name="in" type="float" interfacename="specular" />
213+
</dot>
214+
<dot name="specular_color" type="color3">
215+
<input name="in" type="color3" interfacename="specular_color" />
216+
</dot>
217+
206218
<!-- Specular Index of Refraction -->
207219
<dot name="ior" type="float">
208220
<input name="in" type="float" interfacename="specular_IOR" />
@@ -236,6 +248,8 @@
236248
<output name="base_color_out" type="color3" nodename="base_color" />
237249
<output name="metallic_out" type="float" nodename="metallic" />
238250
<output name="roughness_out" type="float" nodename="roughness" />
251+
<output name="specular_out" type="float" nodename="specular" />
252+
<output name="specular_color_out" type="color3" nodename="specular_color" />
239253
<output name="ior_out" type="float" nodename="ior" />
240254
<output name="anisotropy_strength_out" type="float" nodename="anisotropy_strength" />
241255
<output name="anisotropy_rotation_out" type="float" nodename="anisotropy_rotation" />

0 commit comments

Comments
 (0)