model fmt & heisenbug
[carveJwlIkooP6JGAAIwe30JlM.git] / shaders / vg / character.vs.glsl
1 layout (location=0) in vec3 a_co;
2 layout (location=1) in vec3 a_norm;
3 layout (location=2) in vec4 a_colour;
4 layout (location=3) in vec2 a_uv;
5
6 #line 2 0
7
8 uniform mat4 uPv;
9 uniform mat4x3 uMdl;
10 uniform float uOpacity;
11
12 out vec4 aColour;
13 out vec2 aUv;
14 out vec3 aNorm;
15 out vec3 aCo;
16 out float aOpacity;
17
18 void main()
19 {
20 vec3 world_pos = uMdl * vec4(a_co,1.0);
21 gl_Position = uPv * vec4(world_pos,1.0);
22
23 aColour = a_colour;
24 aUv = a_uv;
25 aNorm = mat3(uMdl) * a_norm;
26 aCo = a_co;
27 aOpacity = 1.0-(gl_Position.y+0.5)*uOpacity;
28 }