2016-06-14 11:11:37 +00:00
|
|
|
#version 150
|
2016-04-28 20:07:05 +00:00
|
|
|
uniform sampler2D image;
|
2018-06-15 15:08:54 +00:00
|
|
|
uniform sampler2D previous_image;
|
|
|
|
uniform bool mix_previous;
|
2016-04-28 20:07:05 +00:00
|
|
|
|
2018-06-15 15:08:54 +00:00
|
|
|
uniform vec2 output_resolution;
|
|
|
|
uniform vec2 origin;
|
|
|
|
const vec2 input_resolution = vec2(160, 144);
|
2016-04-28 20:07:05 +00:00
|
|
|
|
2016-06-14 11:11:37 +00:00
|
|
|
out vec4 frag_color;
|
|
|
|
|
2017-12-23 15:29:42 +00:00
|
|
|
vec4 modified_frag_cord;
|
2016-06-08 21:06:55 +00:00
|
|
|
#line 1
|
2016-04-28 20:07:05 +00:00
|
|
|
{filter}
|
|
|
|
|
2018-06-15 15:08:54 +00:00
|
|
|
void main()
|
|
|
|
{
|
|
|
|
vec2 position = gl_FragCoord.xy - origin;
|
|
|
|
position /= output_resolution;
|
|
|
|
position.y = 1 - position.y;
|
2017-12-23 15:29:42 +00:00
|
|
|
|
2018-06-15 15:08:54 +00:00
|
|
|
if (mix_previous) {
|
|
|
|
frag_color = mix(scale(image, position), scale(previous_image, position), 0.5);
|
2016-04-28 20:07:05 +00:00
|
|
|
}
|
|
|
|
else {
|
2018-06-15 15:08:54 +00:00
|
|
|
frag_color = scale(image, position);
|
2016-04-28 20:07:05 +00:00
|
|
|
}
|
2018-06-15 15:08:54 +00:00
|
|
|
}
|