From 19c30e3ddd490a82e980e80be8b12301daa6b10c Mon Sep 17 00:00:00 2001 From: Jonas Kulla Date: Wed, 2 Oct 2013 15:00:17 +0200 Subject: [PATCH] Fix shader code. Thanks Mesa! On the other hand, the kind of shit fglrx just lets through boggles the mind. --- shader/bitmapBlit.frag | 6 +++--- shader/blurH.vert | 4 ++-- shader/blurV.vert | 4 ++-- shader/plane.frag | 4 ++-- shader/sprite.frag | 4 ++-- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/shader/bitmapBlit.frag b/shader/bitmapBlit.frag index 902c88b..2e75e65 100644 --- a/shader/bitmapBlit.frag +++ b/shader/bitmapBlit.frag @@ -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); diff --git a/shader/blurH.vert b/shader/blurH.vert index cfb87c5..9a4720f 100644 --- a/shader/blurH.vert +++ b/shader/blurH.vert @@ -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; } diff --git a/shader/blurV.vert b/shader/blurV.vert index 6558d25..754c628 100644 --- a/shader/blurV.vert +++ b/shader/blurV.vert @@ -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; } diff --git a/shader/plane.frag b/shader/plane.frag index 02a82b8..7364d10 100644 --- a/shader/plane.frag +++ b/shader/plane.frag @@ -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 */ diff --git a/shader/sprite.frag b/shader/sprite.frag index 9bb3591..744c9d4 100644 --- a/shader/sprite.frag +++ b/shader/sprite.frag @@ -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 */