No Description

passthrough.tese 837B

123456789101112131415161718192021222324252627282930
  1. #version 450
  2. #extension GL_ARB_separate_shader_objects : enable
  3. #extension GL_ARB_shading_language_420pack : enable
  4. layout (triangles) in;
  5. layout (binding = 1) uniform UBO
  6. {
  7. mat4 projection;
  8. mat4 model;
  9. float tessAlpha;
  10. } ubo;
  11. layout (location = 0) in vec3 inNormal[];
  12. layout (location = 1) in vec2 inUV[];
  13. layout (location = 0) out vec3 outNormal;
  14. layout (location = 1) out vec2 outUV;
  15. void main(void)
  16. {
  17. gl_Position = (gl_TessCoord.x * gl_in[0].gl_Position) +
  18. (gl_TessCoord.y * gl_in[1].gl_Position) +
  19. (gl_TessCoord.z * gl_in[2].gl_Position);
  20. gl_Position = ubo.projection * ubo.model * gl_Position;
  21. outNormal = gl_TessCoord.x*inNormal[0] + gl_TessCoord.y*inNormal[1] + gl_TessCoord.z*inNormal[2];
  22. outUV = gl_TessCoord.x*inUV[0] + gl_TessCoord.y*inUV[1] + gl_TessCoord.z*inUV[2];
  23. }