Fixed an issue where the GLSL shader alpha values would be handled differently depending on the graphics driver.

This commit is contained in:
Leon Styhre 2021-02-28 12:59:08 +01:00
parent b44a21dc5a
commit 2dbcb6a7d9
3 changed files with 9 additions and 3 deletions

View file

@ -105,7 +105,9 @@ void main()
float sampleWeights4 = 0.024067905;
float sampleWeights5 = 0.0021112196;
vec4 color = COMPAT_TEXTURE(Source, texcoord) * sampleWeights1;
// Alpha is handled differently depending on the graphics drivers, so set it explicitly to 1.0.
vec4 color = COMPAT_TEXTURE(Source, texcoord);
color = vec4(color.rgb, 1.0) * sampleWeights1;
// unroll the loop
color += COMPAT_TEXTURE(Source, texcoord + vec2(sampleOffsets2* HW * PIXEL_SIZE.x, 0.0)) * sampleWeights2;

View file

@ -106,7 +106,9 @@ void main()
float sampleWeights4 = 0.024067905;
float sampleWeights5 = 0.0021112196;
vec4 color = COMPAT_TEXTURE(Source, texcoord) * sampleWeights1;
// Alpha is handled differently depending on the graphics drivers, so set it explicitly to 1.0.
vec4 color = COMPAT_TEXTURE(Source, texcoord);
color = vec4(color.rgb, 1.0) * sampleWeights1;
// unroll the loop
color += COMPAT_TEXTURE(Source, texcoord + vec2(0.0, sampleOffsets2* VW * PIXEL_SIZE.y)) * sampleWeights2;

View file

@ -28,7 +28,9 @@ varying vec2 vTexCoord;
void main()
{
vec4 dimColor = vec4(dimValue, dimValue, dimValue, 1.0);
vec4 color = texture2D(myTexture, vTexCoord) * dimColor;
vec4 color = texture2D(myTexture, vTexCoord);
// Alpha is handled differently depending on the graphics drivers, so set it explicitly to 1.0.
color = vec4(color.rgb, 1.0) * dimColor;
gl_FragColor = color;
}