diff options
author | Rainer Hochecker <fernetmenta@online.de> | 2017-10-03 11:30:22 +0200 |
---|---|---|
committer | Rainer Hochecker <fernetmenta@online.de> | 2017-10-05 18:06:51 +0200 |
commit | dfcd6a2429f274498bc120ef58d873ad0f7a677c (patch) | |
tree | b715666ebda73c7f9542242d73fd2732c33ade07 /system/shaders/GL | |
parent | 18f600fa1e0d84b70e58ce2bc297ddcbd11a4b08 (diff) |
VideoPlayer: OpenGL, rework and fix shaders
Diffstat (limited to 'system/shaders/GL')
-rw-r--r-- | system/shaders/GL/1.2/gl_convolution-4x4.glsl | 5 | ||||
-rw-r--r-- | system/shaders/GL/1.2/gl_convolution-6x6.glsl | 5 | ||||
-rw-r--r-- | system/shaders/GL/1.2/gl_stretch.glsl (renamed from system/shaders/GL/1.2/gl_streatch.glsl) | 3 | ||||
-rw-r--r-- | system/shaders/GL/1.2/gl_yuv2rgb_basic.glsl | 7 | ||||
-rw-r--r-- | system/shaders/GL/1.5/gl_convolution-4x4.glsl | 3 | ||||
-rw-r--r-- | system/shaders/GL/1.5/gl_convolution-6x6.glsl | 3 | ||||
-rw-r--r-- | system/shaders/GL/1.5/gl_stretch.glsl (renamed from system/shaders/GL/1.5/gl_streatch.glsl) | 3 | ||||
-rw-r--r-- | system/shaders/GL/1.5/gl_videofilter_frag.glsl | 2 | ||||
-rw-r--r-- | system/shaders/GL/1.5/gl_yuv2rgb_basic.glsl | 7 |
9 files changed, 20 insertions, 18 deletions
diff --git a/system/shaders/GL/1.2/gl_convolution-4x4.glsl b/system/shaders/GL/1.2/gl_convolution-4x4.glsl index cf2a0f5378..ee3610915e 100644 --- a/system/shaders/GL/1.2/gl_convolution-4x4.glsl +++ b/system/shaders/GL/1.2/gl_convolution-4x4.glsl @@ -21,6 +21,7 @@ uniform sampler2D img; uniform vec2 stepxy; uniform float m_stretch; +uniform float m_alpha; varying vec2 m_cord; #if (USE1DTEXTURE) @@ -103,11 +104,7 @@ vec4 process() line(xystart.y + stepxy.y * 2.0, xpos, linetaps) * columntaps.b + line(xystart.y + stepxy.y * 3.0, xpos, linetaps) * columntaps.a; -#ifdef GL_ES rgb.a = m_alpha; -#else - rgb.a = gl_Color.a; -#endif return rgb; } diff --git a/system/shaders/GL/1.2/gl_convolution-6x6.glsl b/system/shaders/GL/1.2/gl_convolution-6x6.glsl index c4f51fd431..30fb2817b0 100644 --- a/system/shaders/GL/1.2/gl_convolution-6x6.glsl +++ b/system/shaders/GL/1.2/gl_convolution-6x6.glsl @@ -21,6 +21,7 @@ uniform sampler2D img; uniform vec2 stepxy; uniform float m_stretch; +uniform float m_alpha; varying vec2 m_cord; #if (USE1DTEXTURE) @@ -114,11 +115,7 @@ vec4 process() line(xystart.y + stepxy.y * 4.0, xpos1, xpos2, linetaps1, linetaps2) * columntaps1.b + line(xystart.y + stepxy.y * 5.0, xpos1, xpos2, linetaps1, linetaps2) * columntaps2.b; -#ifdef GL_ES rgb.a = m_alpha; -#else - rgb.a = gl_Color.a; -#endif return rgb; } diff --git a/system/shaders/GL/1.2/gl_streatch.glsl b/system/shaders/GL/1.2/gl_stretch.glsl index f27204fe8c..9cc33883dd 100644 --- a/system/shaders/GL/1.2/gl_streatch.glsl +++ b/system/shaders/GL/1.2/gl_stretch.glsl @@ -22,6 +22,7 @@ uniform sampler2D img; uniform float m_stretch; +uniform float m_alpha; varying vec2 m_cord; vec2 stretch(vec2 pos) @@ -36,5 +37,5 @@ vec2 stretch(vec2 pos) void main() { gl_FragColor.rgb = texture2D(img, stretch(m_cord)).rgb; - gl_FragColor.a = gl_Color.a; + gl_FragColor.a = m_alpha; } diff --git a/system/shaders/GL/1.2/gl_yuv2rgb_basic.glsl b/system/shaders/GL/1.2/gl_yuv2rgb_basic.glsl index 11738cf3cc..0a198b1474 100644 --- a/system/shaders/GL/1.2/gl_yuv2rgb_basic.glsl +++ b/system/shaders/GL/1.2/gl_yuv2rgb_basic.glsl @@ -33,6 +33,7 @@ varying vec2 m_cordV; uniform vec2 m_step; uniform mat4 m_yuvmat; uniform float m_stretch; +uniform float m_alpha; vec2 stretch(vec2 pos) { @@ -64,7 +65,7 @@ vec4 process() , 1.0 ); rgb = m_yuvmat * yuv; - rgb.a = gl_Color.a; + rgb.a = m_alpha; #elif defined(XBMC_NV12_RRG) @@ -75,7 +76,7 @@ vec4 process() , 1.0 ); rgb = m_yuvmat * yuv; - rgb.a = gl_Color.a; + rgb.a = m_alpha; #elif defined(XBMC_YUY2) || defined(XBMC_UYVY) @@ -114,7 +115,7 @@ vec4 process() vec4 yuv = vec4(outY, outUV, 1.0); rgb = m_yuvmat * yuv; - rgb.a = gl_Color.a; + rgb.a = m_alpha; #endif diff --git a/system/shaders/GL/1.5/gl_convolution-4x4.glsl b/system/shaders/GL/1.5/gl_convolution-4x4.glsl index 02ff96d6f0..33f6e1210b 100644 --- a/system/shaders/GL/1.5/gl_convolution-4x4.glsl +++ b/system/shaders/GL/1.5/gl_convolution-4x4.glsl @@ -3,6 +3,7 @@ uniform sampler2D img; uniform vec2 stepxy; uniform float m_stretch; +uniform float m_alpha; in vec2 m_cord; out vec4 fragColor; @@ -86,6 +87,6 @@ vec4 process() line(xystart.y + stepxy.y * 2.0, xpos, linetaps) * columntaps.b + line(xystart.y + stepxy.y * 3.0, xpos, linetaps) * columntaps.a; - rgb.a = fragColor.a; + rgb.a = m_alpha; return rgb; } diff --git a/system/shaders/GL/1.5/gl_convolution-6x6.glsl b/system/shaders/GL/1.5/gl_convolution-6x6.glsl index 814f536b30..b6e7c39968 100644 --- a/system/shaders/GL/1.5/gl_convolution-6x6.glsl +++ b/system/shaders/GL/1.5/gl_convolution-6x6.glsl @@ -3,6 +3,7 @@ uniform sampler2D img; uniform vec2 stepxy; uniform float m_stretch; +uniform float m_alpha; in vec2 m_cord; out vec4 fragColor; @@ -97,7 +98,7 @@ vec4 process() line(xystart.y + stepxy.y * 4.0, xpos1, xpos2, linetaps1, linetaps2) * columntaps1.b + line(xystart.y + stepxy.y * 5.0, xpos1, xpos2, linetaps1, linetaps2) * columntaps2.b; - rgb.a = fragColor.a; + rgb.a = m_alpha; return rgb; } diff --git a/system/shaders/GL/1.5/gl_streatch.glsl b/system/shaders/GL/1.5/gl_stretch.glsl index 9972a7ce3b..d30c55b545 100644 --- a/system/shaders/GL/1.5/gl_streatch.glsl +++ b/system/shaders/GL/1.5/gl_stretch.glsl @@ -2,6 +2,7 @@ uniform sampler2D img; uniform float m_stretch; +uniform float m_alpha; in vec2 m_cord; out fragColor; @@ -17,5 +18,5 @@ vec2 stretch(vec2 pos) void main() { fragColor.rgb = texture(img, stretch(m_cord)).rgb; - fragColor.a = gl_Color.a; + fragColor.a = m_alpha; } diff --git a/system/shaders/GL/1.5/gl_videofilter_frag.glsl b/system/shaders/GL/1.5/gl_videofilter_frag.glsl index 2d7ba2288c..2eb4155f99 100644 --- a/system/shaders/GL/1.5/gl_videofilter_frag.glsl +++ b/system/shaders/GL/1.5/gl_videofilter_frag.glsl @@ -1,10 +1,12 @@ #version 150 uniform sampler2D img; +uniform float m_alpha; in vec2 m_cord; out vec4 fragColor; void main() { fragColor = texture(img, m_cord); + fragColor.a = m_alpha; } diff --git a/system/shaders/GL/1.5/gl_yuv2rgb_basic.glsl b/system/shaders/GL/1.5/gl_yuv2rgb_basic.glsl index a9c37dd486..791d98c51a 100644 --- a/system/shaders/GL/1.5/gl_yuv2rgb_basic.glsl +++ b/system/shaders/GL/1.5/gl_yuv2rgb_basic.glsl @@ -11,6 +11,7 @@ uniform sampler2D m_sampV; uniform vec2 m_step; uniform mat4 m_yuvmat; uniform float m_stretch; +uniform float m_alpha; in vec2 m_cordY; in vec2 m_cordU; in vec2 m_cordV; @@ -46,7 +47,7 @@ vec4 process() , 1.0 ); rgb = m_yuvmat * yuv; - rgb.a = fragColor.a; + rgb.a = m_alpha; #elif defined(XBMC_NV12_RRG) @@ -56,7 +57,7 @@ vec4 process() , texture(m_sampV, stretch(m_cordV)).g , 1.0 ); rgb = m_yuvmat * yuv; - rgb.a = fragColor.a; + rgb.a = m_alpha; #elif defined(XBMC_YUY2) || defined(XBMC_UYVY) @@ -88,7 +89,7 @@ vec4 process() vec4 yuv = vec4(outY, outUV, 1.0); rgb = m_yuvmat * yuv; - rgb.a = fragColor.a; + rgb.a = m_alpha; #endif |