shaderSimpleFlatClip.vert 658 Bytes
Newer Older
Sylvain Thery's avatar
Sylvain Thery committed
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
//ShaderSimpleFlat::vertexShaderClipText

ATTRIBUTE vec3 VertexPosition, VertexNormal;
#ifdef WITH_COLOR
ATTRIBUTE vec3 VertexColor;
#endif
uniform mat4 ModelViewProjectionMatrix;
uniform mat4 ModelViewMatrix;
uniform vec3 lightPosition;
VARYING_VERT vec3 LightDir;
VARYING_VERT vec3 Position;

VARYING_VERT vec3 posClip;

#ifdef WITH_COLOR
VARYING_VERT vec3 Color;
#endif

INVARIANT_POS;
void main ()
{
	Position = vec3 (ModelViewMatrix * vec4 (VertexPosition, 1.0));
	LightDir = lightPosition - Position;
	#ifdef WITH_COLOR
		Color = VertexColor;
	#endif

	posClip = VertexPosition;
	gl_Position = ModelViewProjectionMatrix * vec4 (VertexPosition, 1.0);
}