outfit_purpleneon_vertex.frag

main 35 lines · 978 bytes Raw
Alex Alex Commit Client Upload Part 1 19/10/2026 00:04
1attribute vec2 a_TexCoord;
2uniform mat3 u_TextureMatrix;
3varying vec2 v_TexCoord;
4varying vec2 v_TexCoord2;
5varying vec2 v_TexCoord3;
6attribute vec2 a_Vertex;
7uniform mat3 u_TransformMatrix;
8uniform mat3 u_ProjectionMatrix;
9uniform vec2 u_Offset;
10uniform vec2 u_Center;
11uniform float u_Time;
12
13vec2 effectTextureSize = vec2(615.0, 346.0);
14vec2 direction = vec2(1.0,1.0);
15float speed = 4.0;
16float angle = 1.0;
17
18vec2 rotate(vec2 v, float a) {
19 float s = sin(a);
20 float c = cos(a);
21 mat2 m = mat2(c, -s, s, c);
22 return m * v;
23}
24
25void main()
26{
27 vec2 offset = direction * speed * u_Time;
28 gl_Position = vec4((u_ProjectionMatrix * u_TransformMatrix * vec3(a_Vertex.xy, 1.0)).xy, 1, 1);
29 v_TexCoord = (u_TextureMatrix * vec3(a_TexCoord,1.0)).xy;
30 v_TexCoord2 = (u_TextureMatrix * vec3(a_TexCoord + u_Offset,1.0)).xy;
31
32 v_TexCoord3 = ((a_TexCoord + rotate(direction, (angle / 180.0) * 3.14) * u_Time * speed) / effectTextureSize);
33}
34
35
Top