-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
glut_222.vert
34 lines (27 loc) · 843 Bytes
/
glut_222.vert
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
30
31
32
33
34
#ifdef GL_ES
precision highp float;
#endif
#extension GL_OES_standard_derivatives : enable
#extension GL_ARB_separate_shader_objects : enable
attribute vec3 aPosition;
attribute vec3 aNormal;
attribute vec2 aTexCoord;
attribute vec4 aVertexColor;
varying out vec4 VertexPosition;
uniform mat4 uModelViewMatrix;
uniform mat4 uProjectionMatrix;
uniform mat3 uNormalMatrix;
varying out vec3 var_vertPos;
varying out vec4 var_vertCol;
varying out vec3 var_vertNormal;
varying out vec2 var_vertTexCoord;
void main()
{
mat4 MVP = gl_ProjectionMatrix * gl_ModelViewMatrix;
gl_Position = MVP * gl_Vertex;
VertexPosition = uProjectionMatrix * uModelViewMatrix * vec4(aPosition, 1.0);
var_vertPos = aPosition;
var_vertCol = aVertexColor;
var_vertNormal = aNormal;
var_vertTexCoord = (uModelViewMatrix * gl_Vertex).xy;
}