Advertisement
thecplusplusguy

GLSL tutorial 4 - vertex.vs

Aug 3rd, 2012
1,623
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.49 KB | None | 0 0
  1. //http://www.youtube.com/user/thecplusplusguy
  2. //GLSL tutorial - per-fragment (per-pixel lighting)
  3. //vertex.vs
  4. #version 120
  5. varying vec3 position;
  6. varying vec3 normal;
  7.  
  8. void main()
  9. {
  10.     gl_Position=gl_ModelViewProjectionMatrix*gl_Vertex; //output position with projection
  11.     position=vec3(gl_ModelViewMatrix*gl_Vertex);    //get the position of the vertex after translation, rotation, scaling
  12.     normal=gl_NormalMatrix*gl_Normal;   //get the normal direction, after translation, rotation, scaling
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement