File tree Expand file tree Collapse file tree 1 file changed +3
-0
lines changed Expand file tree Collapse file tree 1 file changed +3
-0
lines changed Original file line number Diff line number Diff line change @@ -17,12 +17,15 @@ uniform float brightness;\n\
1717uniform float vignette_sharpness;\n' ;
1818
1919const VIGNETTE_CODE = '\
20+ const float NOISE_GRANULARITY = 1.0/255.0;\n\
2021cogl_color_out.a = cogl_color_in.a;\n\
2122cogl_color_out.rgb = vec3(0.0, 0.0, 0.0);\n\
2223vec2 position = cogl_tex_coord_in[0].xy - 0.5;\n\
2324float t = length(2.0 * position);\n\
2425t = clamp(t, 0.0, 1.0);\n\
2526float pixel_brightness = mix(1.0, 1.0 - vignette_sharpness, t);\n\
27+ float pseudo_rand = fract(sin(dot(position.xy, vec2(12.9898,78.233))) * 43758.5453);\n\
28+ pixel_brightness += mix(-NOISE_GRANULARITY, NOISE_GRANULARITY, pseudo_rand);\n\
2629cogl_color_out.a = cogl_color_out.a * (1 - pixel_brightness * brightness);' ;
2730;
2831
You can’t perform that action at this time.
0 commit comments