Encounter GLSL
This commit is contained in:
1 parent
882b530366
commit
fe97b2ca13
1 file changed
+16
@@ -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)));
|
||||||
|
}
|
||||||
Reference in new issue
Block a user