Skip to content

Commit f611f6d

Browse files
authored
Align REFRACTION_TWO_SIDED in GLSL and MSL rendering (#2703)
While investigating render differences between GLSL and MSL in #2697 I noticed the dielectric transmission case wasn't matching. After a little investigation it appears that in the MSL render module we're missing setting `HW::REFRACTION_TWO_SIDED `. Which causes a different path to be taken through the shader code [here](https://github.com/AcademySoftwareFoundation/MaterialX/blob/main/libraries/pbrlib/genglsl/lib/mx_transmission_refract.glsl#L9). If more differences appear like this, it may be worth investigating a `MaterialXRenderHW` module to encapsulate the common code.
1 parent 14abb7a commit f611f6d

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

source/MaterialXRenderMsl/MslPipelineStateObject.mm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -741,6 +741,7 @@ int GetStrideOfMetalType(MTLDataType type)
741741
}
742742
}
743743
}
744+
bindUniform(HW::REFRACTION_TWO_SIDED, Value::createValue(lightHandler->getRefractionTwoSided()), false);
744745

745746
// Bind direct lighting properties.
746747
if (hasUniform(HW::NUM_ACTIVE_LIGHT_SOURCES))

0 commit comments

Comments
 (0)