I am trying to create a grid of points by calculating vertex positions dynamically based on their index in the array of vertices sent to the shader. Is there an equivalent to the gl_VertexID variable that I can call from my shader? Or another way to access your position in an array without having to send more data to the GPU? Thanks, Josh.
Here is my vertex shader:
attribute vec4 vertexPosition; uniform mat4 modelViewProjectionMatrix; vec4 temp; uniform float width; void main() { temp = vertexPosition;
source share