DKGL2 sample codes

mesh.vert 497B

123456789101112131415161718192021222324252627
  1. #version 450
  2. layout (location = 0) in vec3 inPos;
  3. layout (location = 1) in vec3 inColor;
  4. layout (location = 2) in vec2 inTexCoord;
  5. layout (binding = 0) uniform UBO
  6. {
  7. mat4 projection;
  8. mat4 model;
  9. mat4 view;
  10. } ubo;
  11. layout (location = 0) out vec3 fragColor;
  12. layout (location = 1) out vec2 fragTexCoord;
  13. out gl_PerVertex
  14. {
  15. vec4 gl_Position;
  16. };
  17. void main()
  18. {
  19. gl_Position = ubo.projection * ubo.view * ubo.model * vec4(inPos, 1.0);
  20. fragColor = inColor;
  21. fragTexCoord = inTexCoord;
  22. }