26 lines
837 B
GLSL
26 lines
837 B
GLSL
![]() |
varying vec4 diffuse, ambientGlobal, ambient;
|
||
|
varying vec3 normal, pos;
|
||
|
/*varying vec3 normal, lightVector, reflectVector, eyeVector;*/
|
||
|
|
||
|
|
||
|
void main() {
|
||
|
normal = normalize(gl_NormalMatrix * gl_Normal);
|
||
|
|
||
|
pos = vec3(gl_ModelViewMatrix * gl_Vertex);
|
||
|
/*lightVector = vec3(gl_LightSource[0].position - ecPos);
|
||
|
|
||
|
reflectVector = normalize(reflect(-lightVector, normal));
|
||
|
eyeVector = vec3(-ecPos);*/
|
||
|
|
||
|
/* Compute the diffuse, ambient and globalAmbient terms */
|
||
|
diffuse = gl_FrontMaterial.diffuse * gl_LightSource[0].diffuse;
|
||
|
|
||
|
/* The ambient terms have been separated since one of them */
|
||
|
/* suffers attenuation */
|
||
|
ambient = gl_FrontMaterial.ambient * gl_LightSource[0].ambient;
|
||
|
ambientGlobal = gl_LightModel.ambient * gl_FrontMaterial.ambient;
|
||
|
|
||
|
gl_TexCoord[0] = gl_MultiTexCoord0;
|
||
|
gl_Position = ftransform();
|
||
|
}
|