No Description

base.vert 652B

123456789101112131415161718192021222324252627282930313233
  1. #version 450
  2. #extension GL_ARB_separate_shader_objects : enable
  3. #extension GL_ARB_shading_language_420pack : enable
  4. layout (location = 0) in vec3 inPos;
  5. layout (location = 1) in vec3 inColor;
  6. layout (binding = 0) uniform UboView
  7. {
  8. mat4 projection;
  9. mat4 view;
  10. } uboView;
  11. layout (binding = 1) uniform UboInstance
  12. {
  13. mat4 model;
  14. } uboInstance;
  15. layout (location = 0) out vec3 outColor;
  16. out gl_PerVertex
  17. {
  18. vec4 gl_Position;
  19. };
  20. void main()
  21. {
  22. outColor = inColor;
  23. mat4 modelView = uboView.view * uboInstance.model;
  24. vec3 worldPos = vec3(modelView * vec4(inPos, 1.0));
  25. gl_Position = uboView.projection * modelView * vec4(inPos.xyz, 1.0);
  26. }