Is there any way to vary the point size when drawing lots of points? I know there's the glPointSize(float), but is there a way to do it in a 'batch' or array?
I would like the points to have different sizes based on an attribute of the data. Such as each point having x, y, z, and a size attribute. I'm using frame buffers right now in java.
Could I possibly use vertex shaders for this?
You can use point sprite: enable it using glEnable(GL_VERTEX_PROGRAM_POINT_SIZE);
and then you can use gl_PointSize
attribute in your vertex program.
Vertex shader example taken from an OpenGL discussion thread:
void main() {
gl_FrontColor=gl_Color;
gl_PointSize = gl_Normal.x;
gl_Position = ftransform();
}