This repository has been archived on 2023-05-27. You can view files and clone it, but cannot push or open issues or pull requests.
api8/shaders/zoom_in.fs

19 lines
390 B
Forth
Raw Normal View History

2023-05-19 11:44:09 +02:00
#version 330
2023-05-19 13:01:20 +02:00
uniform sampler2D tex0;
uniform sampler2D tex1;
2023-05-25 10:14:12 +02:00
uniform float progress;
2023-05-19 12:09:54 +02:00
in vec2 vsoTexCoord;
out vec4 fragColor;
2023-05-19 13:01:20 +02:00
void main() {
vec2 center = vec2(0.5);
2023-05-25 10:14:12 +02:00
vec2 zoomedTexCoord = mix(center, vsoTexCoord, progress);
2023-05-19 13:01:20 +02:00
vec4 color1 = texture(tex0, vsoTexCoord);
vec4 color2 = texture(tex1, zoomedTexCoord);
2023-05-25 10:14:12 +02:00
fragColor = mix(color1, color2, smoothstep(0., 1., progress));
2023-05-19 11:44:09 +02:00
}