1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#version 140

uniform mat4 viewProjectionMatrix;
uniform mat3 normalMatrix;

in vec3 position;
in vec2 texCoords;
in vec3 normal;
in vec3 tangent;
in float bitangentSign;

in vec3 instancePosition; //Per instance attribute


out vec3 vNormal;
out vec3 vTangent;
out float vBitangentSign;

out vec2 vTexCoords;

void main(){
    gl_Position = viewProjectionMatrix * vec4(position + instancePosition, 1);
    
    vTexCoords = texCoords;
    
    vNormal = normalMatrix * normal;
    vTangent = normalMatrix * tangent;
    vBitangentSign = bitangentSign;
}