Changeset 1948


Ignore:
Timestamp:
Sep 24, 2012, 8:44:41 AM (5 years ago)
Author:
sam
Message:

core: add some noise to the gradient effect.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/gradient.lolfx

    r1941 r1948  
    3838                    15.0, 10.0,  9.0, 14.0);
    3939
     40float rand(vec2 p)
     41{
     42    return fract(sin(dot(p, vec2(12.9898, 78.2333))) * 123.4567);
     43}
     44
    4045void main()
    4146{
     
    4449    int dx = int(mod(gl_FragCoord.x, 4.0));
    4550    int dy = int(mod(gl_FragCoord.y, 4.0));
    46     /* Cluster */
    4751    float t;
    4852    if (dx == 0)
     
    6670                     [int(mod(gl_FragCoord.y, 4.0))];
    6771#endif
     72    t += rand(gl_FragCoord.xy) - 0.5;
    6873    t = (t + 0.5) / 17.0;
    6974    col.x += fract(t - col.x) - t;
Note: See TracChangeset for help on using the changeset viewer.