From aa8bca2968fddbd7f6e5fb8cdb3caa4eb1501080 Mon Sep 17 00:00:00 2001 From: Dan McGarry Date: Fri, 7 Jul 2023 12:29:27 -0700 Subject: [PATCH] Use the updated HW Token in MaterialX 1.38.7 --- .../render/MaterialXGenOgsXml/GlslFragmentGenerator.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/mayaUsd/render/MaterialXGenOgsXml/GlslFragmentGenerator.cpp b/lib/mayaUsd/render/MaterialXGenOgsXml/GlslFragmentGenerator.cpp index 1d97be1a30..586132cb5e 100644 --- a/lib/mayaUsd/render/MaterialXGenOgsXml/GlslFragmentGenerator.cpp +++ b/lib/mayaUsd/render/MaterialXGenOgsXml/GlslFragmentGenerator.cpp @@ -289,8 +289,13 @@ ShaderPtr GlslFragmentGenerator::generate( _tokenSubstitutions[ShaderGenerator::T_FILE_TRANSFORM_UV] = (context.getOptions().fileTextureVerticalFlip ? "mx_transform_uv_vflip.glsl" : "mx_transform_uv.glsl"); +#if MX_COMBINED_VERSION <= 13806 _tokenSubstitutions[HW::T_REFRACTION_ENV] = MX_REFRACTION_SUBSTITUTION; -#endif +#else + // Renamed in 1.38.7 + _tokenSubstitutions[HW::T_REFRACTION_TWO_SIDED] = MX_REFRACTION_SUBSTITUTION; +#endif // <= 13806 +#endif // <= 13804 // Add all functions for node implementations emitFunctionDefinitions(graph, context, pixelStage);