Encounter GLSL

This commit is contained in:
markojozsef
2026-09-15 16:58:02 +02:00
parent 882b530366
commit fe97b2ca13

16
encounter_shadertoy.glsl Normal file
View File

@@ -0,0 +1,16 @@
#define RESOLUTION (1. / iResolution.xy)
#define MAX_MOSAIC 16.
#define SPEED 48.
#define FADEOUT_TIME 1.30
#define FADOUT_SPEED 3.
void mainImage( out vec4 fragColor, in vec2 fragCoord )
{
vec2 uv = fragCoord/iResolution.xy;
float mosaic = floor(((iTime * SPEED) < MAX_MOSAIC) ? iTime * SPEED : (iTime * SPEED) - MAX_MOSAIC) + 1.;
uv = floor(uv / RESOLUTION / mosaic) * RESOLUTION * mosaic;
// Output to screen
fragColor = texture(iChannel0,uv) * max(0., min(1., (FADEOUT_TIME * FADOUT_SPEED) - (iTime * FADOUT_SPEED)));
}