aboutsummaryrefslogtreecommitdiff
path: root/system/shaders
diff options
context:
space:
mode:
authorbobo1on1 <bobo1on1@svn>2010-07-10 19:31:35 +0000
committerbobo1on1 <bobo1on1@svn>2010-07-10 19:31:35 +0000
commitc84cddf230b4b245f92fad6b07dad99a56c31b06 (patch)
tree50f34db200b4217288284648eb7ec6956c6f5e6b /system/shaders
parent652da10c25d932b110f94fdc95c9262d20e65b4b (diff)
added: non-linear stretch for GL_ARB_texture_rectangle
fixed: non-linear stretch doesn't work on POT so don't allow it git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk@31699 568bbfeb-2a22-0410-94d2-cc84cf5bfa90
Diffstat (limited to 'system/shaders')
-rw-r--r--system/shaders/yuv2rgb_basic.glsl9
1 files changed, 7 insertions, 2 deletions
diff --git a/system/shaders/yuv2rgb_basic.glsl b/system/shaders/yuv2rgb_basic.glsl
index 138ffd89bd..4df222b0f6 100644
--- a/system/shaders/yuv2rgb_basic.glsl
+++ b/system/shaders/yuv2rgb_basic.glsl
@@ -23,8 +23,13 @@ vec2 stretch(vec2 pos)
// our transform should map [0..1] to itself, with f(0) = 0, f(1) = 1, f(0.5) = 0.5, and f'(0.5) = b.
// a simple curve to do this is g(x) = b(x-0.5) + (1-b)2^(n-1)(x-0.5)^n + 0.5
// where the power preserves sign. n = 2 is the simplest non-linear case (required when b != 1)
- float x = pos.x - 0.5;
- return vec2(mix(2.0 * x * abs(x), x, m_stretch) + 0.5, pos.y);
+ #if(XBMC_texture_rectangle)
+ float x = (pos.x * m_step.x) - 0.5;
+ return vec2((mix(2.0 * x * abs(x), x, m_stretch) + 0.5) / m_step.x, pos.y);
+ #else
+ float x = pos.x - 0.5;
+ return vec2(mix(2.0 * x * abs(x), x, m_stretch) + 0.5, pos.y);
+ #endif
#else
return pos;
#endif