[Scummvm-git-logs] scummvm master -> 5f3cb0f95c0b2611ea1eef084f93e9da7c50341f

aquadran noreply at scummvm.org
Sat Aug 16 10:07:27 UTC 2025


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .

Summary:
5f3cb0f95c WINTERMUTE: Corrected alpha channel in X mesh shader


Commit: 5f3cb0f95c0b2611ea1eef084f93e9da7c50341f
    https://github.com/scummvm/scummvm/commit/5f3cb0f95c0b2611ea1eef084f93e9da7c50341f
Author: Paweł Kołodziejski (aquadran at gmail.com)
Date: 2025-08-16T12:07:21+02:00

Commit Message:
WINTERMUTE: Corrected alpha channel in X mesh shader

Changed paths:
    engines/wintermute/base/gfx/opengl/shaders/wme_modelx.fragment
    engines/wintermute/base/gfx/opengl/shaders/wme_modelx.vertex


diff --git a/engines/wintermute/base/gfx/opengl/shaders/wme_modelx.fragment b/engines/wintermute/base/gfx/opengl/shaders/wme_modelx.fragment
index 9fde1f0b73b..dcb69d0a7a4 100644
--- a/engines/wintermute/base/gfx/opengl/shaders/wme_modelx.fragment
+++ b/engines/wintermute/base/gfx/opengl/shaders/wme_modelx.fragment
@@ -20,7 +20,7 @@ void main() {
 	}
 
 	if (enableFog) {
-		outColor = mix(fogColor, outColor, fogFactor);
+		outColor.rgb = mix(fogColor.rgb, outColor.rgb, fogFactor);
 	}
 
 	if (UBOOL_TEST(alphaTest) && outColor.a < alphaRef) {
diff --git a/engines/wintermute/base/gfx/opengl/shaders/wme_modelx.vertex b/engines/wintermute/base/gfx/opengl/shaders/wme_modelx.vertex
index b3f88d386ec..67f5615b9ba 100644
--- a/engines/wintermute/base/gfx/opengl/shaders/wme_modelx.vertex
+++ b/engines/wintermute/base/gfx/opengl/shaders/wme_modelx.vertex
@@ -50,7 +50,6 @@ void main() {
 		float intensity = 1.0;
 		vec4 lightPosition = viewMatrix * lights[i]._position;
 		vec3 vertexToLight = lightPosition.xyz - viewCoords.xyz;
-		float dist = length(vertexToLight);
 
 		if (lights[i]._direction.w < 0.0) { // Spotlight
 			vec4 lightDirection = viewMatrix * vec4(lights[i]._direction.xyz, 0.0);
@@ -69,13 +68,11 @@ void main() {
 		}
 
 		intensity *= max(0.0, dot(normalEye, normalize(vertexToLight)));
-		light.rgb += lights[i]._color.rgb * intensity;
+		light += lights[i]._color.rgb * intensity;
 	}
 
-	Color.rgba *= vec4(light.rgb, 1.0);
-	Color.rgba += vec4(ambient.rgb * ambientLight.rgb, 1.0);
+	Color.rgb *= light;
+	Color.rgb += ambient.rgb * ambientLight.rgb;
 
-	Color.r = min(Color.r, 1.0);
-	Color.g = min(Color.g, 1.0);
-	Color.b = min(Color.b, 1.0);
+	Color.rgb = clamp(Color.rgb, 0.0, 1.0);
 }




More information about the Scummvm-git-logs mailing list