From fbed81bb98a559c7c8d539d4b6479358547ffdfb Mon Sep 17 00:00:00 2001 From: itsmattkc <34096995+itsmattkc@users.noreply.github.com> Date: Fri, 7 Jan 2022 16:16:59 -0800 Subject: [PATCH] math: ensure alpha remains in 0.0-1.0 range --- app/node/math/math/mathbase.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/node/math/math/mathbase.cpp b/app/node/math/math/mathbase.cpp index 1e95cad97..90cafd08b 100644 --- a/app/node/math/math/mathbase.cpp +++ b/app/node/math/math/mathbase.cpp @@ -105,7 +105,9 @@ ShaderCode MathNodeBase::GetShaderCodeInternal(const QString &shader_id, const Q "varying vec2 ove_texcoord;\n" "\n" "void main(void) {\n" - " gl_FragColor = %5;\n" + " vec4 c = %5;\n" + " c.a = clamp(c.a, 0.0, 1.0);\n" // Ensure alpha is 1.0 + " gl_FragColor = c;\n" "}\n").arg(GetShaderUniformType(type_a), GetShaderUniformType(type_b), param_a_in,