PDA

View Full Version : Most effecient way to draw a sphere



LDBlackford
03-11-2004, 01:58 PM
Sorry if this seems like a stupid question, but my boss wants me to ask. I am trying to draw as many spheres as possible at one time. Currently using gluSphere(*,3,2), I can display about 300,000 spheres (RAM 1GB). If I use glVertex3d and GL_POINT_SMOOTH, they look spherical and I can get about 3,000,000, but they don't function correctly when I zoom in on them (they get smaller).
Are there any functions, settings, etc. that I am missing that would allow me to draw more (properly functioning) spheres in a windows openGL view?

endash
03-11-2004, 02:30 PM
If you are drawing points, it's not a surprise that that they don't behave like spheres.

Why do you need to draw so many (tiny) spheres? Is this a particle system?

LDBlackford
03-12-2004, 05:37 AM
Originally posted by endash:
If you are drawing points, it's not a surprise that that they don't behave like spheres.
Why do you need to draw so many (tiny) spheres? Is this a particle system?
I understand that points won't work. We are trying to visualize the sampling of a 3D space and want to "show" the millions of sampling positions as spheres in that 3D space. gluSphere seems to require so much memory that on a 1GB RAM machine the view fails with around 300,000 spheres using the minimal gluSphere(3,2), and at around 100,000 spheres using gluSphere(6,4). Just wanted to make sure there wasn't an option or alternative that I was missing.
Thanks
Les

V-man
03-13-2004, 05:57 PM
Why create 300000 spheres when you can create 1 and render it as many times as you want.
Use display lists or VBO.

forth
11-17-2004, 05:05 AM
If your driver allows you can use GL_ARB_point_parameters extension (see OpenGL Extensions Registry (http://oss.sgi.com/projects/ogl-sample/registry/) for description). It was specially disigned for this kind of application.

pleopard
11-17-2004, 07:22 AM
Or ... just a simple billboarded quad with a sphere texture on it (e.g. particle system).