aboutsummaryrefslogtreecommitdiff
path: root/data/light-pp.vert
blob: 8333aaef61c36677a5f2f9fa5ac8725351a7d146 (plain)
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
35
36
37
/*
 * light-pp.vert
 *
 * Lighting per pixel
 *
 * (c) 2007 Thomas White <taw27@cam.ac.uk>
 *
 *  dtr - Diffraction Tomography Reconstruction
 *
 */

varying vec3 col_ambi;
varying vec3 col_diff;
varying vec3 col_spec;
varying vec3 col_emit;
varying float shininess;

varying vec3 normal;
varying vec3 lightvc;
varying vec3 lighthvc;

void main() {
	
	normal = normalize(gl_NormalMatrix * gl_Normal);
	lightvc = normalize(vec3(gl_LightSource[0].position));
	lighthvc = normalize(gl_LightSource[0].halfVector.xyz);
	
	col_ambi = gl_Color.rgb;
	col_diff = gl_Color.rgb;
	col_spec = gl_FrontMaterial.specular.rgb;
	col_emit = gl_FrontMaterial.emission.rgb;
	shininess = gl_FrontMaterial.shininess;
	
	gl_Position = ftransform();
	
}