summaryrefslogtreecommitdiffstats
path: root/video/out/gl_video_shaders.glsl
diff options
context:
space:
mode:
Diffstat (limited to 'video/out/gl_video_shaders.glsl')
-rw-r--r--video/out/gl_video_shaders.glsl21
1 files changed, 21 insertions, 0 deletions
diff --git a/video/out/gl_video_shaders.glsl b/video/out/gl_video_shaders.glsl
index 4037e42449..dac19cb673 100644
--- a/video/out/gl_video_shaders.glsl
+++ b/video/out/gl_video_shaders.glsl
@@ -168,6 +168,8 @@ uniform vec2 chroma_center_offset;
uniform vec2 chroma_div;
uniform sampler2D lut_c;
uniform sampler2D lut_l;
+uniform sampler1D lut_polar_c;
+uniform sampler1D lut_polar_l;
#if HAVE_3DTEX
uniform sampler3D lut_3d;
#endif
@@ -297,6 +299,25 @@ float[6] weights6(sampler2D lookup, float f) {
return res; \
}
+
+#define SAMPLE_CONVOLUTION_POLAR_R(NAME, R, LUT) \
+ vec4 NAME(VIDEO_SAMPLER tex, vec2 texsize, vec2 texcoord) { \
+ vec2 pt = vec2(1.0) / texsize; \
+ vec2 fcoord = fract(texcoord * texsize - vec2(0.5)); \
+ vec2 base = texcoord - fcoord * pt; \
+ vec4 res = vec4(0); \
+ float wsum = 0; \
+ for (int y = 1-R; y <= R; y++) { \
+ for (int x = 1-R; x <= R; x++) { \
+ vec2 d = vec2(x,y) - fcoord; \
+ float w = texture1D(LUT, sqrt(d.x*d.x + d.y*d.y)/R).r; \
+ wsum += w; \
+ res += w * texture(tex, base + pt * vec2(x, y)); \
+ } \
+ } \
+ return res / wsum; \
+ }
+
#ifdef DEF_SCALER0
DEF_SCALER0
#endif