glowing_blue_frag.frag

main 32 lines · 932 bytes Raw
Alex Alex Commit Client Upload Part 1 19/10/2026 00:04
1uniform mat4 u_Color;
2varying vec2 v_TexCoord;
3varying vec2 v_TexCoord2;
4varying vec2 v_TexCoord3;
5varying vec2 v_Position;
6uniform sampler2D u_Tex0;
7uniform float u_Time;
8uniform vec2 u_Resolution;
9
10void main()
11{
12 gl_FragColor = texture2D(u_Tex0, v_TexCoord);
13 vec4 texcolor = texture2D(u_Tex0, v_TexCoord2);
14 vec4 texcolor2 = texture2D(u_Tex0, v_TexCoord3);
15 if(texcolor.r > 0.9) {
16 gl_FragColor *= texcolor.g > 0.9 ? u_Color[0] : u_Color[1];
17 } else if(texcolor.g > 0.9) {
18 gl_FragColor *= u_Color[2];
19 } else if(texcolor.b > 0.9) {
20 gl_FragColor *= u_Color[3];
21 }
22 if(gl_FragColor.a < 0.01) {
23 if(texcolor2.a > 0.01) {
24 // Interpolate between different shades of green based on time
25 float greenValue = 0.5 + abs(0.5 - mod(u_Time, 1.0));
26 gl_FragColor = vec4(0.0, greenValue, 1.0, 1.0);
27 } else {
28 discard;
29 }
30 }
31}
32
Top