aboutsummaryrefslogtreecommitdiff
path: root/system/shaders
diff options
context:
space:
mode:
authorLauri Myllari <lauri.myllari@gmail.com>2015-05-04 22:46:56 -0700
committerRainer Hochecker <fernetmenta@online.de>2015-12-06 19:55:21 +0100
commita4eb99246c03bb0f8558bc553a706141eca8e4d7 (patch)
tree92f7ea875dfd410517edd2eda0d9dfb3d77657ad /system/shaders
parent0b280bab2b7cc93944ea4b0d8ecf8b441051499b (diff)
gl: split output stage from convolution shaders
Diffstat (limited to 'system/shaders')
-rw-r--r--system/shaders/convolution-4x4.glsl8
-rw-r--r--system/shaders/convolution-6x6.glsl8
2 files changed, 10 insertions, 6 deletions
diff --git a/system/shaders/convolution-4x4.glsl b/system/shaders/convolution-4x4.glsl
index 8c035bafd0..d41b127294 100644
--- a/system/shaders/convolution-4x4.glsl
+++ b/system/shaders/convolution-4x4.glsl
@@ -81,8 +81,9 @@ half3 line (float ypos, vec4 xpos, half4 linetaps)
pixel(xpos.a, ypos) * linetaps.a;
}
-void main()
+vec4 process()
{
+ vec4 rgb;
vec2 pos = stretch(cord) + stepxy * 0.5;
vec2 f = fract(pos / stepxy);
@@ -96,12 +97,13 @@ void main()
vec2 xystart = (-1.5 - f) * stepxy + pos;
vec4 xpos = vec4(xystart.x, xystart.x + stepxy.x, xystart.x + stepxy.x * 2.0, xystart.x + stepxy.x * 3.0);
- gl_FragColor.rgb =
+ rgb.rgb =
line(xystart.y , xpos, linetaps) * columntaps.r +
line(xystart.y + stepxy.y , xpos, linetaps) * columntaps.g +
line(xystart.y + stepxy.y * 2.0, xpos, linetaps) * columntaps.b +
line(xystart.y + stepxy.y * 3.0, xpos, linetaps) * columntaps.a;
- gl_FragColor.a = gl_Color.a;
+ rgb.a = gl_Color.a;
+ return rgb;
}
diff --git a/system/shaders/convolution-6x6.glsl b/system/shaders/convolution-6x6.glsl
index 5da4822891..68c53661dd 100644
--- a/system/shaders/convolution-6x6.glsl
+++ b/system/shaders/convolution-6x6.glsl
@@ -83,8 +83,9 @@ half3 line (float ypos, vec3 xpos1, vec3 xpos2, half3 linetaps1, half3 linetaps2
pixel(xpos2.b, ypos) * linetaps2.b;
}
-void main()
+vec4 process()
{
+ vec4 rgb;
vec2 pos = stretch(cord) + stepxy * 0.5;
vec2 f = fract(pos / stepxy);
@@ -105,7 +106,7 @@ void main()
vec3 xpos1 = vec3(xystart.x, xystart.x + stepxy.x, xystart.x + stepxy.x * 2.0);
vec3 xpos2 = vec3(xystart.x + stepxy.x * 3.0, xystart.x + stepxy.x * 4.0, xystart.x + stepxy.x * 5.0);
- gl_FragColor.rgb =
+ rgb =
line(xystart.y , xpos1, xpos2, linetaps1, linetaps2) * columntaps1.r +
line(xystart.y + stepxy.y , xpos1, xpos2, linetaps1, linetaps2) * columntaps2.r +
line(xystart.y + stepxy.y * 2.0, xpos1, xpos2, linetaps1, linetaps2) * columntaps1.g +
@@ -113,6 +114,7 @@ void main()
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;
- gl_FragColor.a = gl_Color.a;
+ rgb.a = gl_Color.a;
+ return rgb;
}