xxxxxxxxxx
29
precision mediump float;
uniform vec2 u_resolution;
uniform float u_time;
uniform vec2 u_mouse;
uniform sampler2D u_img;
float amount = 0.7;
float random2D(vec2 coord) {
return fract(sin(dot(coord.xy, vec2(12.9898, 78.233))) * 43758.5453);
}
void main() {
vec2 coord = gl_FragCoord.xy / u_resolution;
vec3 color = vec3(0.0);
vec4 image = texture2D(u_img, coord);
float noise = (random2D(coord) - 0.5) * amount;
image.r += noise;
image.g += noise;
image.b += noise;
gl_FragColor = image;
}