Binary that renders a triangle using Open GL, scans the resulting image to a PNG, and makes an occlusion query to determine the number of fragments shaded. To be used as reference when developing Turnip.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

occlusion.vert 606B

1234567891011121314151617181920212223242526272829
  1. #version 300 es
  2. #extension GL_EXT_separate_shader_objects : enable
  3. precision mediump float;
  4. layout(location = 0) out vec3 fragColor;
  5. vec3 positions[6] = vec3[](
  6. vec3(0.5, -0.5, 0.4),
  7. vec3(0.5, 0.5, 0.4),
  8. vec3(-0.5, 0.5, 0.4),
  9. vec3(-0.5, -0.5, 0.6),
  10. vec3(0.5, 0.5, 0.6),
  11. vec3(-0.5, 0.5, 0.6)
  12. );
  13. vec3 colors[6] = vec3[](
  14. vec3(1.0, 0.0, 0.0),
  15. vec3(1.0, 0.0, 0.0),
  16. vec3(1.0, 0.0, 0.0),
  17. vec3(0.0, 1.0, 0.0),
  18. vec3(0.0, 1.0, 0.0),
  19. vec3(0.0, 1.0, 0.0)
  20. );
  21. void main() {
  22. gl_Position = vec4(positions[gl_VertexID], 1.0);
  23. fragColor = colors[gl_VertexID];
  24. }