2016-06-14 11:11:37 +00:00
|
|
|
#version 150
|
2016-04-28 20:07:05 +00:00
|
|
|
uniform sampler2D image;
|
|
|
|
uniform sampler2D previousImage;
|
|
|
|
uniform bool uMixPrevious;
|
|
|
|
|
|
|
|
uniform vec2 uResolution;
|
2017-12-30 20:33:52 +00:00
|
|
|
uniform vec2 uOrigin;
|
2016-04-28 20:07:05 +00:00
|
|
|
const vec2 textureDimensions = vec2(160, 144);
|
|
|
|
|
2016-06-14 11:11:37 +00:00
|
|
|
out vec4 frag_color;
|
|
|
|
|
2017-12-30 20:33:52 +00:00
|
|
|
vec4 modified_frag_cord;
|
|
|
|
#define gl_FragCoord modified_frag_cord
|
2016-06-08 21:06:55 +00:00
|
|
|
#line 1
|
2016-04-28 20:07:05 +00:00
|
|
|
{filter}
|
2017-12-30 20:33:52 +00:00
|
|
|
#undef gl_FragCoord
|
2016-04-28 20:07:05 +00:00
|
|
|
|
|
|
|
void main() {
|
2017-12-30 20:33:52 +00:00
|
|
|
modified_frag_cord = gl_FragCoord - vec4(uOrigin.x, uOrigin.y, 0, 0);
|
|
|
|
|
2016-04-28 20:07:05 +00:00
|
|
|
if (uMixPrevious) {
|
2016-06-14 11:11:37 +00:00
|
|
|
frag_color = mix(scale(image), scale(previousImage), 0.5);
|
2016-04-28 20:07:05 +00:00
|
|
|
}
|
|
|
|
else {
|
2016-06-14 11:11:37 +00:00
|
|
|
frag_color = scale(image);
|
2016-04-28 20:07:05 +00:00
|
|
|
}
|
|
|
|
}
|