blob: f3d225c350cb5a165815f0ac8367e418466a4aa4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
float hash(vec2 p) {
vec3 p3 = fract(vec3(p.xyx) * 1689.1984);
p3 += dot(p3, p3.yzx + 33.33);
return fract((p3.x + p3.y) * p3.z);
}
vec4 blurFinish(vec4 pixColor, vec2 v_texcoord, float noise, float brightness) {
// noise
float noiseHash = hash(v_texcoord);
float noiseAmount = noiseHash - 0.5;
pixColor.rgb += noiseAmount * noise;
// brightness
pixColor.rgb *= min(1.0, brightness);
return pixColor;
}
|