This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Setup: | |
1. Index buffer containing N quads (each 2 triangles), where N is the max amount of spheres. Repeating pattern of {0,1,2,1,3,2} + K*4. | |
2. No vertex buffer. | |
Render N*2 triangles, where N is the number of spheres you have. | |
Vertex shader: | |
1. Sphere index = N/4 (N = SV_VertexId) | |
2. Quad coord: Q = float2(N%2, (N%4)/2) * 2.0 - 1.0 | |
3. Transform sphere center -> pos |