runnable fragment
code snippet
precision mediump float;
varying vec2 v_texCoord;
uniform sampler2D u_texture;
uniform vec2 u_resolution;
uniform float u_intensity; // 0-1
uniform float u_size; // grain size (0.5-10)
uniform int u_color; // 0=color, 1=grayscale
float hash(vec2 p) {
return fract(sin(dot(p, vec2(12.9898, 78.233))) * 43758.5453);
}
void main() {
vec4 c = texture2D(u_texture, v_texCoord);