Skip to content

Commit e30b0b5

Browse files
Align MDL boolean and integer conversion with GLSL/OSL (#2807)
1 parent d18bb19 commit e30b0b5

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

source/MaterialXGenMdl/MdlShaderGenerator.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,9 +273,9 @@ ShaderPtr MdlShaderGenerator::generate(const string& name, ElementPtr element, G
273273
emitLine("float3 displacement__ = float3(0.0)", stage);
274274
std::string finalOutput = "mk_color3(0.0)";
275275
if (outputType == Type::BOOLEAN)
276-
finalOutput = result + " ? mk_color3(0.0, 1.0, 0.0) : mk_color3(1.0, 0.0, 0.0)";
276+
finalOutput = result + " ? mk_color3(1.0, 1.0, 1.0) : mk_color3(0.0, 0.0, 0.0)";
277277
else if (outputType == Type::INTEGER)
278-
finalOutput = "mk_color3(" + result + " / 100)"; // arbitrary
278+
finalOutput = "mk_color3(" + result + ")";
279279
else if (outputType == Type::FLOAT)
280280
finalOutput = "mk_color3(" + result + ")";
281281
else if (outputType == Type::VECTOR2)

0 commit comments

Comments
 (0)