home *** CD-ROM | disk | FTP | other *** search
/ Game Programming in C++ - Start to Finish / GameProgrammingS.iso / tools_install / gDEBugger-2_1_book.msi / tpVertexShader.glsl < prev   
Encoding:
Text File  |  2005-06-14  |  1.0 KB  |  30 lines

  1. //------------------------------ tpVertexShader.glsl ------------------------------
  2.  
  3. // --------------------------------------------------------
  4. //  ⌐ 2004-2005 Graphic Remedy. All Rights Reserved.
  5. // --------------------------------------------------------
  6.  
  7. // Will get the surface normal:
  8. varying vec3 surfaceNormal;
  9.  
  10. // Will get the vertex position:
  11. varying vec3 vertexPosition;
  12.  
  13.  
  14. // ---------------------------------------------------------------------------
  15. // Name:        Teapot application vertex shader main function
  16. // ---------------------------------------------------------------------------
  17. void main(void)
  18. {
  19.     // Calculate the vertex position in eye coordinates:
  20.     vertexPosition = vec3(gl_ModelViewMatrix * gl_Vertex);
  21.     
  22.     // Calculate the surface normal in eye coordinates:
  23.     surfaceNormal = normalize(gl_NormalMatrix * gl_Normal);
  24.  
  25.     // Output texture unit 0 coordinates:
  26.     gl_TexCoord[0] = gl_MultiTexCoord0;
  27.  
  28.     // Output the transformed vertex position:
  29.     gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
  30. }