aboutsummaryrefslogtreecommitdiff
path: root/system/shaders/yuv2rgb_basic.glsl
diff options
context:
space:
mode:
authorbobo1on1 <bobo1on1@svn>2010-07-10 19:31:13 +0000
committerbobo1on1 <bobo1on1@svn>2010-07-10 19:31:13 +0000
commit652da10c25d932b110f94fdc95c9262d20e65b4b (patch)
tree20a3cee6b6ea28b7707b813a6dbc91fea9bf147f /system/shaders/yuv2rgb_basic.glsl
parentcdc94dba577adc493ef15e2a581c725d872198ab (diff)
fixed: sampling coordinates
git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk@31698 568bbfeb-2a22-0410-94d2-cc84cf5bfa90
Diffstat (limited to 'system/shaders/yuv2rgb_basic.glsl')
-rw-r--r--system/shaders/yuv2rgb_basic.glsl11
1 files changed, 7 insertions, 4 deletions
diff --git a/system/shaders/yuv2rgb_basic.glsl b/system/shaders/yuv2rgb_basic.glsl
index 9f432b67b4..138ffd89bd 100644
--- a/system/shaders/yuv2rgb_basic.glsl
+++ b/system/shaders/yuv2rgb_basic.glsl
@@ -48,18 +48,21 @@ void main()
#if(XBMC_texture_rectangle)
vec2 stepxy = vec2(1.0, 1.0);
- vec2 pos = stretch(vec2(m_cordY.x - 0.25, m_cordY.y));
+ vec2 pos = stretch(m_cordY);
+ pos = vec2(pos.x - 0.25, pos.y);
vec2 f = fract(pos);
#else
vec2 stepxy = m_step;
- vec2 pos = stretch(vec2(m_cordY.x - stepxy.x * 0.25, m_cordY.y));
+ vec2 pos = stretch(m_cordY);
+ pos = vec2(pos.x - stepxy.x * 0.25, pos.y);
vec2 f = fract(pos / stepxy);
#endif
+
//y axis will be correctly interpolated by opengl
//x axis will not, so we grab two pixels at the center of two columns and interpolate ourselves
- vec4 c1 = texture2D(m_sampY, vec2(pos.x + (-0.5 - f.x) * stepxy.x, pos.y));
- vec4 c2 = texture2D(m_sampY, vec2(pos.x + ( 0.5 - f.x) * stepxy.x, pos.y));
+ vec4 c1 = texture2D(m_sampY, vec2(pos.x + (0.5 - f.x) * stepxy.x, pos.y));
+ vec4 c2 = texture2D(m_sampY, vec2(pos.x + (1.5 - f.x) * stepxy.x, pos.y));
/* each pixel has two Y subpixels and one UV subpixel
YUV Y YUV