Skip to content

Commit e5b1831

Browse files
Consolidate glTF PBR graph and remove GLSL override (#2850)
This changelist consolidates the dielectric iridescence path in the glTF PBR shading graph, and removes the hand-authored GLSL graph override that is no longer needed. The following specific changes are included: - Restructure the dielectric iridescence path from `mix(layer(A, C), layer(B, C), w)` to `layer(mix(A, B, w), C)`, eliminating a duplicated layer node that was a workaround for earlier codegen limitations. - Remove the hand-authored GLSL graph override for `gltf_pbr`, as the `PremultipliedBsdfAddRefactor` pass now reproduces these optimizations automatically from the consolidated global graph.
1 parent 51ccf9d commit e5b1831

2 files changed

Lines changed: 10 additions & 348 deletions

File tree

libraries/bxdf/genglsl/gltf_pbr.mtlx

Lines changed: 0 additions & 330 deletions
This file was deleted.

libraries/bxdf/gltf_pbr.mtlx

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -167,13 +167,7 @@
167167
<input name="mix" type="float" interfacename="transmission" />
168168
</mix>
169169

170-
<layer name="dielectric_bsdf" type="BSDF">
171-
<input name="top" type="BSDF" nodename="reflection_bsdf" />
172-
<input name="base" type="BSDF" nodename="transmission_mix" />
173-
</layer>
174-
175-
<!-- Thin-film + Dielectric
176-
Note: Due to limitations in codegen, the base layer BSDF is duplicated (#1035). -->
170+
<!-- Thin-film + Dielectric -->
177171

178172
<generalized_schlick_bsdf name="tf_reflection_bsdf" type="BSDF">
179173
<input name="color0" type="color3" nodename="dielectric_f0" />
@@ -186,18 +180,17 @@
186180
<input name="thinfilm_ior" type="float" interfacename="iridescence_ior" />
187181
</generalized_schlick_bsdf>
188182

183+
<mix name="mix_iridescent_dielectric_reflection" type="BSDF">
184+
<input name="bg" type="BSDF" nodename="reflection_bsdf" />
185+
<input name="fg" type="BSDF" nodename="tf_reflection_bsdf" />
186+
<input name="mix" type="float" interfacename="iridescence" />
187+
</mix>
189188

190-
<layer name="tf_dielectric_bsdf" type="BSDF">
191-
<input name="top" type="BSDF" nodename="tf_reflection_bsdf" />
189+
<layer name="iridescent_dielectric_bsdf" type="BSDF">
190+
<input name="top" type="BSDF" nodename="mix_iridescent_dielectric_reflection" />
192191
<input name="base" type="BSDF" nodename="transmission_mix" />
193192
</layer>
194193

195-
<mix name="mix_iridescent_dielectric_bsdf" type="BSDF">
196-
<input name="bg" type="BSDF" nodename="dielectric_bsdf" />
197-
<input name="fg" type="BSDF" nodename="tf_dielectric_bsdf" />
198-
<input name="mix" type="float" interfacename="iridescence" />
199-
</mix>
200-
201194
<!-- Metal -->
202195

203196
<generalized_schlick_bsdf name="metal_bsdf" type="BSDF">
@@ -208,8 +201,7 @@
208201
<input name="tangent" type="vector3" nodename="selected_tangent" />
209202
</generalized_schlick_bsdf>
210203

211-
<!-- Thin-film + Metal
212-
Note: Due to limitations in codegen, the base layer BSDF is duplicated (#1035). -->
204+
<!-- Thin-film + Metal -->
213205

214206
<generalized_schlick_bsdf name="tf_metal_bsdf" type="BSDF">
215207
<input name="color0" type="color3" interfacename="base_color" />
@@ -230,7 +222,7 @@
230222
<!-- Dielectric/metal mix -->
231223

232224
<mix name="base_mix" type="BSDF">
233-
<input name="bg" type="BSDF" nodename="mix_iridescent_dielectric_bsdf" />
225+
<input name="bg" type="BSDF" nodename="iridescent_dielectric_bsdf" />
234226
<input name="fg" type="BSDF" nodename="mix_iridescent_metal_bsdf" />
235227
<input name="mix" type="float" interfacename="metallic" />
236228
</mix>

0 commit comments

Comments
 (0)