diff options
author | bobo1on1 <bobo1on1@svn> | 2010-03-11 16:42:59 +0000 |
---|---|---|
committer | bobo1on1 <bobo1on1@svn> | 2010-03-11 16:42:59 +0000 |
commit | 068a39c5b66f351b6cd696716255c8346e57cc80 (patch) | |
tree | b5af304574d05c29f2f2e64824829a008a916cdc /system/shaders | |
parent | 677d8adf475650ec989e35f925124f4f9a501853 (diff) |
changed: use 8 bit kernel when float textures are not supported, it's equally wrong but a lot faster
git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk@28540 568bbfeb-2a22-0410-94d2-cc84cf5bfa90
Diffstat (limited to 'system/shaders')
-rw-r--r-- | system/shaders/convolution-4x4.glsl | 8 | ||||
-rw-r--r-- | system/shaders/convolution-6x6.glsl | 8 |
2 files changed, 4 insertions, 12 deletions
diff --git a/system/shaders/convolution-4x4.glsl b/system/shaders/convolution-4x4.glsl index b0f6d6fb84..01690fac77 100644 --- a/system/shaders/convolution-4x4.glsl +++ b/system/shaders/convolution-4x4.glsl @@ -1,4 +1,5 @@ uniform sampler2D img; +uniform sampler1D kernelTex; uniform float stepx; uniform float stepy; uniform float m_stretch; @@ -12,19 +13,14 @@ uniform float m_stretch; #endif #if (HAS_FLOAT_TEXTURE) -uniform sampler1D kernelTex; - half4 weight(float pos) { return texture1D(kernelTex, pos); } #else -uniform sampler2D kernelTex; - half4 weight(float pos) { - //row 0 contains the high byte, row 1 contains the low byte - return (texture2D(kernelTex, vec2(pos, 0.0)) * 256.0 + texture2D(kernelTex, vec2(pos, 1.0))) / 128.5 - 1.0; + return texture1D(kernelTex, pos) * 2.0 - 1.0; } #endif diff --git a/system/shaders/convolution-6x6.glsl b/system/shaders/convolution-6x6.glsl index b440974f70..f791004490 100644 --- a/system/shaders/convolution-6x6.glsl +++ b/system/shaders/convolution-6x6.glsl @@ -1,4 +1,5 @@ uniform sampler2D img; +uniform sampler1D kernelTex; uniform float stepx; uniform float stepy; uniform float m_stretch; @@ -12,19 +13,14 @@ uniform float m_stretch; #endif #if (HAS_FLOAT_TEXTURE) -uniform sampler1D kernelTex; - half3 weight(float pos) { return texture1D(kernelTex, pos).rgb; } #else -uniform sampler2D kernelTex; - half3 weight(float pos) { - //row 0 contains the high byte, row 1 contains the low byte - return ((texture2D(kernelTex, vec2(pos, 0.0)) * 256.0 + texture2D(kernelTex, vec2(pos, 1.0)))).rgb / 128.5 - 1.0; + return texture1D(kernelTex, pos).rgb * 2.0 - 1.0; } #endif |