blob: eca56ea9f6917f59a96b8dc2188232af66ecd880 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
#version 330 core
in vec2 UV;
out vec3 color;
uniform sampler2D clearTex;
uniform sampler2D blurTex;
uniform float iGlobalTime;
float nrand(vec2 n)
{
return fract(sin(dot(n.xy, vec2(19.9898, 78.233))) * 43758.5453);
}
void main()
{
color = vec3(0.0);
//color += texture(tex2, UV).rgb / 2.0;
color += texture(blurTex, UV).rgb;
color = max(vec3(0.0), color - 0.25);
//color *= color;
float flicker = 0.5 + nrand(vec2(iGlobalTime));
//flicker *= (flicker);
flicker = sqrt(flicker);
//flicker = pow(flicker, 1.0/8.0);
color *= flicker;
//color *= mix(vec3(0.0), color, flicker);
color += texture(clearTex, UV).rgb;
//color = clamp(color, vec3(0.0), vec3(1.0));
}
|