antoinefortin
1/6/2020 - 5:10 AM

Basic Shader to compute tiling

Basic Shader to compute tiling

void mainImage( out vec4 fragColor, in vec2 fragCoord )
{
    // Normalized pixel coordinates (from 0 to 1)
    vec2 uv = fragCoord/iResolution.xy;

    /* Position */
    // Taking the UV of screen and starting new uv(0,0) --> (tileX, tileY)
    float tilleX = mod(uv.x, 0.1); 
    float tilleY = mod(uv.y, 0.1); 
    
    vec3 col = vec3(1.);
    
    tilleX *= abs(sin(iTime)) * 5.;
    tilleY *= abs(cos(iTime)) * 2.0;
    // Output to screen
    fragColor = vec4(vec3((tilleX + tilleY) * 2., (tilleX + tilleY),(tilleX + tilleY)),1.0);
}