outfit_circle3_fragment.frag

main 38 lines · 1,004 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_Position;
5uniform sampler2D u_Tex0;
6uniform float u_Time;
7
8// CONFIG
9float speed = 6.0;
10float height = 2.0;
11float radius = 5.0;
12// CONFIG END
13
14vec2 rotate(vec2 v, float a) {
15 float s = sin(a);
16 float c = cos(a);
17 mat2 m = mat2(c, -s, s, c);
18 return m * v;
19}
20
21void main()
22{
23 gl_FragColor = texture2D(u_Tex0, v_TexCoord);
24 vec4 texcolor = texture2D(u_Tex0, v_TexCoord2);
25 if(texcolor.r > 0.9) {
26 gl_FragColor *= texcolor.g > 0.9 ? u_Color[0] : u_Color[1];
27 } else if(texcolor.g > 0.9) {
28 gl_FragColor *= u_Color[2];
29 } else if(texcolor.b > 0.9) {
30 gl_FragColor *= u_Color[3];
31 }
32
33
34 if(texcolor.a > 0.9) {
35 gl_FragColor.xyz *= max(1.0, height / sqrt(abs(abs(sqrt(v_Position.x * v_Position.x + v_Position.y * v_Position.y) / 8.0) - abs(mod(u_Time * speed, radius * 2.0) - radius))));
36 }
37 if(gl_FragColor.a < 0.01) discard;
38}
Top