unlit.vp 607 B

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