aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbobo1on1 <bobo1on1@svn>2010-06-30 23:23:08 +0000
committerbobo1on1 <bobo1on1@svn>2010-06-30 23:23:08 +0000
commit28dbad3d65261f43a782218b8ac301776825830f (patch)
tree3923236e38d435485966e01db992301ced6fef39
parenta793b624b4867daeadf583487bcc3318c8f35893 (diff)
refactor usage of stepxy in videofiltershader
git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk@31534 568bbfeb-2a22-0410-94d2-cc84cf5bfa90
-rw-r--r--system/shaders/convolution-4x4.glsl4
-rw-r--r--system/shaders/convolution-6x6.glsl4
-rw-r--r--xbmc/cores/VideoRenderers/VideoShaders/VideoFilterShader.cpp3
3 files changed, 5 insertions, 6 deletions
diff --git a/system/shaders/convolution-4x4.glsl b/system/shaders/convolution-4x4.glsl
index c02578f874..0de050f107 100644
--- a/system/shaders/convolution-4x4.glsl
+++ b/system/shaders/convolution-4x4.glsl
@@ -62,7 +62,7 @@ half3 line (float ypos, vec4 xpos, half4 linetaps)
void main()
{
- vec2 pos = stretch(gl_TexCoord[0].xy);
+ vec2 pos = stretch(gl_TexCoord[0].xy) + stepxy * 0.5;
vec2 f = fract(pos / stepxy);
half4 linetaps = weight(1.0 - f.x);
@@ -72,7 +72,7 @@ void main()
linetaps /= linetaps.r + linetaps.g + linetaps.b + linetaps.a;
columntaps /= columntaps.r + columntaps.g + columntaps.b + columntaps.a;
- vec2 xystart = (-0.5 - f) * stepxy + pos;
+ vec2 xystart = (-1.5 - f) * stepxy + pos;
vec4 xpos = vec4(xystart.x, xystart.x + stepxy.x, xystart.x + stepxy.x * 2.0, xystart.x + stepxy.x * 3.0);
gl_FragColor.rgb =
diff --git a/system/shaders/convolution-6x6.glsl b/system/shaders/convolution-6x6.glsl
index a455076e0b..255a574686 100644
--- a/system/shaders/convolution-6x6.glsl
+++ b/system/shaders/convolution-6x6.glsl
@@ -64,7 +64,7 @@ half3 line (float ypos, vec3 xpos1, vec3 xpos2, half3 linetaps1, half3 linetaps2
void main()
{
- vec2 pos = stretch(gl_TexCoord[0].xy);
+ vec2 pos = stretch(gl_TexCoord[0].xy) + stepxy * 0.5;
vec2 f = fract(pos / stepxy);
half3 linetaps1 = weight((1.0 - f.x) / 2.0);
@@ -80,7 +80,7 @@ void main()
columntaps1 /= sum;
columntaps2 /= sum;
- vec2 xystart = (-1.5 - f) * stepxy + pos;
+ vec2 xystart = (-2.5 - f) * stepxy + pos;
vec3 xpos1 = vec3(xystart.x, xystart.x + stepxy.x, xystart.x + stepxy.x * 2.0);
vec3 xpos2 = vec3(xystart.x + stepxy.x * 3.0, xystart.x + stepxy.x * 4.0, xystart.x + stepxy.x * 5.0);
diff --git a/xbmc/cores/VideoRenderers/VideoShaders/VideoFilterShader.cpp b/xbmc/cores/VideoRenderers/VideoShaders/VideoFilterShader.cpp
index fc397324cb..1bbf8cae99 100644
--- a/xbmc/cores/VideoRenderers/VideoShaders/VideoFilterShader.cpp
+++ b/xbmc/cores/VideoRenderers/VideoShaders/VideoFilterShader.cpp
@@ -55,10 +55,9 @@ BaseVideoFilterShader::BaseVideoFilterShader()
m_stretch = 0.0f;
string shaderv =
- "uniform vec2 stepxy;"
"void main()"
"{"
- "gl_TexCoord[0].xy = gl_MultiTexCoord0.xy - stepxy * 0.5;"
+ "gl_TexCoord[0].xy = gl_MultiTexCoord0.xy;"
"gl_Position = ftransform();"
"gl_FrontColor = gl_Color;"
"}";