From 34d3235c84ccf094cc9329754b3a9e0dd1addc3b Mon Sep 17 00:00:00 2001 From: Yuri Roubinsky Date: Mon, 8 Feb 2021 19:37:50 +0300 Subject: [PATCH] [3.2] Visual Shader Parenthesis fix --- scene/resources/visual_shader.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scene/resources/visual_shader.cpp b/scene/resources/visual_shader.cpp index f6b2b3528e5..47db5e677a2 100644 --- a/scene/resources/visual_shader.cpp +++ b/scene/resources/visual_shader.cpp @@ -1190,7 +1190,7 @@ Error VisualShader::_write_node(Type type, StringBuilder &global_code, StringBui } else if (in_type == VisualShaderNode::PORT_TYPE_BOOLEAN && out_type == VisualShaderNode::PORT_TYPE_SCALAR) { inputs[i] = src_var + " > 0.0 ? true : false"; } else if (in_type == VisualShaderNode::PORT_TYPE_SCALAR && out_type == VisualShaderNode::PORT_TYPE_BOOLEAN) { - inputs[i] = src_var + " ? 1.0 : 0.0"; + inputs[i] = "(" + src_var + " ? 1.0 : 0.0)"; } else if (in_type == VisualShaderNode::PORT_TYPE_VECTOR && out_type == VisualShaderNode::PORT_TYPE_BOOLEAN) { inputs[i] = "vec3(" + src_var + " ? 1.0 : 0.0)"; }