Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support transmission in translation from Standard Surface to glTF PBR #2027

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