generative/shaders/white-noise.frag
Joshua Seigler 4114418129 publish: make room for future sketches
generated from commit 68a08e1763f1028c9229b91f7886406715c44475
2019-11-05 16:58:00 -05:00

21 lines
429 B
GLSL

precision mediump float;
uniform vec2 u_resolution;
uniform float u_alpha;
highp float random(vec2 co) {
highp float a = 12.9898;
highp float b = 78.233;
highp float c = 43758.5453;
highp float dt= dot(co.xy, vec2(a, b));
highp float sn= mod(dt, 3.14);
return fract(sin(sn) * c);
}
void main() {
vec2 st = gl_FragCoord.xy/u_resolution.xy;
float rnd = random(st);
gl_FragColor = vec4(vec3(rnd), u_alpha);
}