Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //http://www.youtube.com/user/thecplusplusguy
- //GLSL tutorial - per-fragment (per-pixel lighting)
- //vertex.vs
- #version 120
- varying vec3 position;
- varying vec3 normal;
- void main()
- {
- gl_Position=gl_ModelViewProjectionMatrix*gl_Vertex; //output position with projection
- position=vec3(gl_ModelViewMatrix*gl_Vertex); //get the position of the vertex after translation, rotation, scaling
- normal=gl_NormalMatrix*gl_Normal; //get the normal direction, after translation, rotation, scaling
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement