From 000c332eee12fbd500a99e5edd75de5968b06e16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 9 Jun 2021 12:58:33 +0200 Subject: [PATCH] Shaders: this was a stupid thing to do. Doesn't actually seem to have any measurable impact (on Intel), so I guess the compiler can realize this as well or it was really unimpactful. --- src/Magnum/Shaders/Phong.frag | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/Magnum/Shaders/Phong.frag b/src/Magnum/Shaders/Phong.frag index 01060818f..79792e3f9 100644 --- a/src/Magnum/Shaders/Phong.frag +++ b/src/Magnum/Shaders/Phong.frag @@ -469,13 +469,7 @@ void main() { highp vec3 normalizedLightDirection = normalize(lightDirection.xyz); lowp float intensity = max(0.0, dot(normalizedTransformedNormal, normalizedLightDirection))*attenuation; - fragmentColor += vec4(finalDiffuseColor.rgb*lightColor*intensity, finalDiffuseColor.a/float( - #ifndef UNIFORM_BUFFERS - LIGHT_COUNT - #else - actualLightCount - #endif - )); + fragmentColor.rgb += finalDiffuseColor.rgb*lightColor*intensity; /* Add specular color, if needed */ if(intensity > 0.001) { @@ -485,6 +479,8 @@ void main() { fragmentColor += vec4(finalSpecularColor.rgb*lightSpecularColor.rgb*specularity, finalSpecularColor.a); } } + + fragmentColor.a += finalDiffuseColor.a; #endif #ifdef ALPHA_MASK