Skip to main content
gamedev.net
🔒 Locked

GL_POINTS Slow

Started by DrPowers 1 reply 1.6k views
Original Post
DrPowers
DrPowers
I was wondering... and this might be impossible... if there was a faster way to display a point cloud rather than GL_POINTS. My target is to show about 100,000 points and be as fast as possible. Let me know if there is a better technique than glbegin(GL_POINTS) 100,000 x glColor3f(r, g, b); glVertex3d(x, y, z); glEnd() in terms of speed
Eric Lengyel
Eric Lengyel
Put your point positions and colors in arrays using glVertexPointer() and glColorPointer(), and then call glDrawArrays(GL_POINTS, ...) instead. This will be much faster than using 100,000 glColor() and glVertex() calls. If you want even more speed, look into using vertex buffer objects (VBOs).
DrPowers
DrPowers
Quote:
Original post by Eric Lengyel
Put your point positions and colors in arrays using glVertexPointer() and glColorPointer(), and then call glDrawArrays(GL_POINTS, ...) instead. This will be much faster than using 100,000 glColor() and glVertex() calls. If you want even more speed, look into using vertex buffer objects (VBOs).


Thats exactly what I was looking for... thanks.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.