unlit.vp 629 B

12345678910111213141516171819202122232425262728
  1. #version 140
  2. // The model's vertex position and texture coordinates.
  3. in vec4 position;
  4. in vec2 texcoord0;
  5. // The model's world matrix.
  6. in mat4 mtx_world;
  7. // The projection and view matrices.
  8. uniform general_vp
  9. {
  10. mat4 mtx_view;
  11. mat4 mtx_proj;
  12. };
  13. // The output of a vertex shader are passed to the fragment shader.
  14. // The texture coordinates of the vertex.
  15. out vec2 var_texcoord0;
  16. void main()
  17. {
  18. // Pass the texture coordinates to the fragment shader.
  19. var_texcoord0 = texcoord0;
  20. // Transform the vertex position to clip space.
  21. gl_Position = mtx_proj * mtx_view * mtx_world * vec4(position.xyz, 1.0);
  22. }