outfit_outline_1.frag

main 52 lines · 1.2 KB 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
10// CONFIG
11float speed = 5.0;
12float height = 12.0;
13float angle = 50.0; // degrees
14float intensity = 2.0;
15// CONFIG END
16
17vec2 rotate(vec2 v, float a) {
18 float s = sin(a);
19 float c = cos(a);
20 mat2 m = mat2(c, -s, s, c);
21 return m * v;
22}
23
24void main()
25{
26 float r = 197.0 / 255.0;
27 float g = 197.0 / 255.0;
28 float b = 197.0 / 255.0;
29
30 float modSpeed = 0.5;
31 float mode = abs(0.5 - mod(u_Time * modSpeed, 1.0)) * 1.5;
32
33 gl_FragColor = texture2D(u_Tex0, v_TexCoord);
34 vec4 texcolor = texture2D(u_Tex0, v_TexCoord2);
35 vec4 texcolor2 = texture2D(u_Tex0, v_TexCoord3);
36 if(texcolor.r > 0.9) {
37 gl_FragColor *= texcolor.g > 0.9 ? u_Color[0] : u_Color[1];
38 } else if(texcolor.g > 0.9) {
39 gl_FragColor *= u_Color[2];
40 } else if(texcolor.b > 0.9) {
41 gl_FragColor *= u_Color[3];
42 }
43
44 if(gl_FragColor.a < 0.01) {
45 if(texcolor2.a > 0.01) {
46 gl_FragColor = vec4(r, g, b, mode);
47 } else {
48 discard;
49 }
50 }
51}
52
Top