Fix shader code. Thanks Mesa!

On the other hand, the kind of shit fglrx
just lets through boggles the mind.
This commit is contained in:
Jonas Kulla 2013-10-02 15:00:17 +02:00
parent bb70c39811
commit 19c30e3ddd
5 changed files with 11 additions and 11 deletions

View File

@ -21,10 +21,10 @@ void main()
vec4 resFrag;
float ab = opacity;
const float as = srcFrag.a;
const float ad = dstFrag.a;
float as = srcFrag.a;
float ad = dstFrag.a;
const float at = ab*as;
float at = ab*as;
resFrag.a = at + ad - ad*at;
resFrag.rgb = mix(dstFrag.rgb, srcFrag.rgb, ab*as);

View File

@ -14,6 +14,6 @@ void main()
gl_Position = projMat * vec4(position, 0, 1);
v_texCoord = texCoord * texSizeInv;
v_blurCoord[0] = vec2(texCoord.x-1, texCoord.y) * texSizeInv;
v_blurCoord[1] = vec2(texCoord.x+1, texCoord.y) * texSizeInv;
v_blurCoord[0] = vec2(texCoord.x-1.0, texCoord.y) * texSizeInv;
v_blurCoord[1] = vec2(texCoord.x+1.0, texCoord.y) * texSizeInv;
}

View File

@ -14,6 +14,6 @@ void main()
gl_Position = projMat * vec4(position, 0, 1);
v_texCoord = texCoord * texSizeInv;
v_blurCoord[0] = vec2(texCoord.x, texCoord.y-1) * texSizeInv;
v_blurCoord[1] = vec2(texCoord.x, texCoord.y+1) * texSizeInv;
v_blurCoord[0] = vec2(texCoord.x, texCoord.y-1.0) * texSizeInv;
v_blurCoord[1] = vec2(texCoord.x, texCoord.y+1.0) * texSizeInv;
}

View File

@ -9,7 +9,7 @@ uniform vec4 flash;
varying vec2 v_texCoord;
const vec3 lumaF = { .299, .587, .114 };
const vec3 lumaF = vec3(.299, .587, .114);
void main()
{
@ -17,7 +17,7 @@ void main()
vec4 frag = texture2D(texture, v_texCoord);
/* Apply gray */
const float luma = dot(frag.rgb, lumaF);
float luma = dot(frag.rgb, lumaF);
frag.rgb = mix(frag.rgb, vec3(luma), tone.w);
/* Apply tone */

View File

@ -11,7 +11,7 @@ uniform float bushOpacity;
varying vec2 v_texCoord;
const vec3 lumaF = { .299, .587, .114 };
const vec3 lumaF = vec3(.299, .587, .114);
void main()
{
@ -19,7 +19,7 @@ void main()
vec4 frag = texture2D(texture, v_texCoord);
/* Apply gray */
const float luma = dot(frag.rgb, lumaF);
float luma = dot(frag.rgb, lumaF);
frag.rgb = mix(frag.rgb, vec3(luma), tone.w);
/* Apply tone */