Creating a sphere by hand

Hi there,

I wanna create a sphere by hand in an optimal way so I decided to use VBO and IBO.

I’ve created the VBO for the vertices of the sphere and I rendered as GL_POINTS and they’re in their right positions.

The question is about the IBO. I was trying to create it in such a way to get advantage of the GL_TRIANGLE_STRIP, but now I’m reading an old post http://www.opengl.org/discussion_boards/…true#Post272666

where Dark Photon said this

Second, using carefully ordered triangles is much more important than using the TRIANGLE_STRIP primitive. Strips are old school and basically dead except for trivial things such regular grids. You’ll get the same performance from indexed TRIANGLEs where the triangle order is the same.

What he means with “You’ll get the same performance from indexed TRIANGLEs where the triangle order is the same.”?

I was trying to create the index to render only triangles using GL_TRIANGLE_STRIP but it seems to be complex to order the vertices. If drawing separated triangles has no penalty in performance I think it’s the easiest way. But I repeat I’m looking for high performance.

Can someone help me with this?

Thank you.

PD: I’m looking for the fastest possible way to render the sphere.

Hi,

Today GPUs are complex machine with both large and efficient pre and post transformation caches, using index arrays with optimized array indexing and positioning could lead to very high vertex throughput.
Look at both NVidia and ATI(AMD) site for cache optimizing libraries. I’ve used tootle form ATI that gave very favorable performance compared to many others I’ve tested.

Ido

Create triangles for the sphere in the most convenient order for you, then in a separate step, optimize them for the pre and post vertex caches on the GPU, as Ido said. This is separate from the sphere triangulation, so it can be used for any triangle mesh. Take a look at these two algorithms:

Linear-Speed Vertex Cache Optimisation
Fast Triangle Reordering for Vertex Locality and Reduced Overdraw

We have implemented the later with much success. If you are concerned about performance, consider level of detail in addition to raw triangle throughput. Also, if the sphere is opaque, make sure to enable back face culling (unless the viewer is inside of it).

Regards,
Patrick