particles.gs 615 B

12345678910111213141516171819202122232425262728293031
  1. #version 430
  2. layout (points) in;
  3. layout (triangle_strip, max_vertices = 3) out;
  4. uniform mat4 proj;
  5. uniform mat4 view;
  6. in float varFade[];
  7. in vec3 varOffsetA[];
  8. in vec3 varOffsetB[];
  9. out float varFadeG;
  10. void main(void) {
  11. vec4 base = gl_in[0].gl_Position;
  12. gl_Position = proj * view * vec4(base.xyz, 1.0);
  13. varFadeG = varFade[0];
  14. EmitVertex();
  15. gl_Position = proj * view * vec4(base.xyz + varOffsetA[0], 1.0);
  16. varFadeG = varFade[0];
  17. EmitVertex();
  18. gl_Position = proj * view * vec4(base.xyz + varOffsetB[0], 1.0);
  19. varFadeG = varFade[0];
  20. EmitVertex();
  21. EndPrimitive();
  22. }