Skip to content

Commit

Permalink
Support transmission in translation from Standard Surface to glTF PBR (
Browse files Browse the repository at this point in the history
…#2027)

This corrects the translation of transmission parameters from Standard Surface to glTF PBR.
Issue: #1599
  • Loading branch information
charo-m authored Sep 29, 2024
1 parent 76bef70 commit 210266b
Showing 1 changed file with 25 additions and 4 deletions.
29 changes: 25 additions & 4 deletions libraries/bxdf/translation/standard_surface_to_gltf_pbr.mtlx
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,24 @@
</dotproduct>

<!-- Metallic roughness -->
<ifequal name="base_color" type="color3">
<ifequal name="baseColor" type="color3">
<input name="value1" type="float" nodename="hasCoatColor" />
<input name="value2" type="float" value="0" />
<input name="in1" type="color3" nodename="scaledBaseColor" />
<input name="in2" type="color3" nodename="mixedBaseColor" />
</ifequal>
<ifgreater name="transmissionBaseColor" type="color3">
<input name="value1" type="float" interfacename="transmission_depth" />
<input name="value2" type="float" value="0" />
<input name="in1" type="color3" value="1, 1, 1" />
<input name="in2" type="color3" interfacename="transmission_color" />
</ifgreater>
<ifgreater name="base_color" type="color3">
<input name="value1" type="float" interfacename="transmission" />
<input name="value2" type="float" value="0" />
<input name="in1" type="color3" nodename="transmissionBaseColor" />
<input name="in2" type="color3" nodename="baseColor" />
</ifgreater>
<dot name="metallic" type="float">
<input name="in" type="float" interfacename="metalness" />
</dot>
Expand All @@ -96,9 +108,18 @@
<dot name="thickness" type="float">
<input name="in" type="float" interfacename="transmission_depth" />
</dot>
<dot name="attenuation_color" type="color3">
<input name="in" type="color3" interfacename="transmission_color" />
</dot>
<ifgreater name="transmissionAttenuationColor" type="color3">
<input name="value1" type="float" interfacename="transmission_depth" />
<input name="value2" type="float" value="0" />
<input name="in1" type="color3" interfacename="transmission_color" />
<input name="in2" type="color3" value="1, 1, 1" />
</ifgreater>
<ifgreater name="attenuation_color" type="color3">
<input name="value1" type="float" interfacename="transmission" />
<input name="value2" type="float" value="0" />
<input name="in1" type="color3" nodename="transmissionAttenuationColor" />
<input name="in2" type="color3" value="1, 1, 1" />
</ifgreater>

<!-- Sheen -->
<multiply name="sheen_color" type="color3">
Expand Down

0 comments on commit 210266b

Please sign in to comment.