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.
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

occlusion.vert 555B

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