Shader.Vert 379 B

12345678910111213141516
  1. varying vec3 Normal;
  2. varying vec3 LightVector;
  3. varying vec3 CameraVector;
  4. varying vec2 Texcoord;
  5. void main(void)
  6. {
  7. gl_Position = ftransform();
  8. Texcoord = gl_MultiTexCoord0.xy;
  9. Normal = normalize(gl_NormalMatrix * gl_Normal);
  10. vec3 p = (gl_ModelViewMatrix * gl_Vertex).xyz;
  11. LightVector = normalize(gl_LightSource[0].position.xyz - p);
  12. CameraVector = normalize(p);
  13. }