SameBoy/Shaders/MasterShader.fsh

27 lines
563 B
Plaintext
Raw Normal View History

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