GLSL tutorials


I started with Bruno Simon’s tutorials to remember basics of GLSL, and already found out interesting combinations:

   //BLINGS MEETING EACH OTHER
    vec2 rotatedUv = rotate(vUV, PI/4.0, vec2(0.5, 0.5));

    vec2 lightUv = vec2(
        rotatedUv.x*0.2 + 0.45,
        rotatedUv.y 
    );

    float strengthX = 0.125 / distance(lightUv, vec2(0.5, 0.5));

    vec2 lightUv2 = vec2(
        rotatedUv.x,
        rotatedUv.y*0.01 + 0.35
    );

     float strengthY = 0.125 / distance(lightUv2, vec2(0.5, 0.5));
     float strength = strengthX * strengthY;

     //CLAMP STRNGTH
    strength = clamp (strength, 0.0, 1.0);

    //COLORED
    vec3 firstColor = vec3(0.0345, 0.07, 0.11);
    vec3 secondColor = vec3(vUV, 1.0);

    vec3 color = mix(firstColor, secondColor, strength);


    gl_FragColor = vec4(vec3(color), 1.0);

This produces gradients that look like light flare like at the cover of this post.