No Description

displacement.tesc 776B

1234567891011121314151617181920212223242526272829303132
  1. #version 450
  2. #extension GL_ARB_separate_shader_objects : enable
  3. #extension GL_ARB_shading_language_420pack : enable
  4. layout (binding = 0) uniform UBO
  5. {
  6. float tessLevel;
  7. } ubo;
  8. layout (vertices = 3) out;
  9. layout (location = 0) in vec3 inNormal[];
  10. layout (location = 1) in vec2 inUV[];
  11. layout (location = 0) out vec3 outNormal[3];
  12. layout (location = 1) out vec2 outUV[3];
  13. void main()
  14. {
  15. if (gl_InvocationID == 0)
  16. {
  17. gl_TessLevelInner[0] = ubo.tessLevel;
  18. gl_TessLevelOuter[0] = ubo.tessLevel;
  19. gl_TessLevelOuter[1] = ubo.tessLevel;
  20. gl_TessLevelOuter[2] = ubo.tessLevel;
  21. }
  22. gl_out[gl_InvocationID].gl_Position = gl_in[gl_InvocationID].gl_Position;
  23. outNormal[gl_InvocationID] = inNormal[gl_InvocationID];
  24. outUV[gl_InvocationID] = inUV[gl_InvocationID];
  25. }