Transform.vert 611 B

1234567891011121314151617181920212223
  1. // ----------------------------------------------------------------
  2. // From Game Programming in C++ by Sanjay Madhav
  3. // Copyright (C) 2017 Sanjay Madhav. All rights reserved.
  4. //
  5. // Released under the BSD License
  6. // See LICENSE in root directory for full details.
  7. // ----------------------------------------------------------------
  8. // Request GLSL 3.3
  9. #version 330
  10. // Uniforms for world transform and view-proj
  11. uniform mat4 uWorldTransform;
  12. uniform mat4 uViewProj;
  13. // Vertex attributes
  14. in vec3 inPosition;
  15. void main()
  16. {
  17. vec4 pos = vec4(inPosition, 1.0);
  18. gl_Position = pos * uWorldTransform * uViewProj;
  19. }