aboutsummaryrefslogtreecommitdiff
path: root/shaders/normal.vert
blob: 34ddce382129601fe9f11ce03411e0b85cc6be33 (plain) (blame)
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
#version 150
in vec3 in_position ;
in vec3 in_normal ;
in vec2 in_texMapping ;

uniform mat4 pMat ;
uniform mat4 mvMat ;
uniform vec3 light ;

out vec3 trueNormal ;
out vec2 texCoord ;
out float intensity ;
out vec4 location ;
out vec3 light2 ;
out vec2 texMapping ;
out mat3 normalMat ;

// (-4.330127,5.0,7.4999995)
void main() {
    light2 = light ; //multMat(mvMat * vec4(light,1)).xyz ;

    location = mvMat * vec4(in_position, 1.0) ;
    gl_Position = pMat * location;
    texCoord = vec2(in_position) * vec2(0.5) + vec2(0.5);
    texMapping = in_texMapping ;
    trueNormal = inverse(transpose(mat3(mvMat))) * (-in_normal) ;
}