Binary that renders a triangle using Vulkan, scans the resulting image to a PNG, and makes an occlusion query to determine the number of fragments shaded. To be used in developing Turnip.
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

occlusion.vert 532B

1234567891011121314151617181920212223242526
  1. #version 450
  2. layout(location = 0) out vec3 fragColor;
  3. vec3 positions[6] = vec3[](
  4. vec3(0.5, -0.5, 1.0),
  5. vec3(0.5, 0.5, 1.0),
  6. vec3(-0.5, 0.5, 1.0),
  7. vec3(-0.5, -0.5, 0.0),
  8. vec3(0.5, 0.5, 0.0),
  9. vec3(-0.5, 0.5, 0.0)
  10. );
  11. vec3 colors[6] = vec3[](
  12. vec3(1.0, 0.0, 0.0),
  13. vec3(1.0, 0.0, 0.0),
  14. vec3(1.0, 0.0, 0.0),
  15. vec3(0.0, 1.0, 0.0),
  16. vec3(0.0, 1.0, 0.0),
  17. vec3(0.0, 1.0, 0.0)
  18. );
  19. void main() {
  20. gl_Position = vec4(positions[gl_VertexIndex], 1.0);
  21. fragColor = colors[gl_VertexIndex];
  22. }