Jump to content
  • Advertisement
Sign in to follow this  
BladeWise

GLU quadrics optimized?

This topic is 4846 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

To display the bounding sphere of an object, I'm using the easy-to-use function gluSphere... rendering 4 cubes with my engine is fine (~1000 FPS, I'm using TAO framework in a GDI window...), but when rendering bounding volumes too, I loose almost 100 FPS... profiling my code, I found that calling gluSphere is quite consuming... since I'm rendering my geometry using VertexArrays, and objects rendering is really faster than bounding rendering, I suppose gluSphere uses glBegin/glEnd blocks... so it's not optimized with VertexArrays... obviusly the slowdown could depend on vertex number since the sphere is composed by more points (I'm drawing cubes by QUADS, anyway, so they are not so optimized too... maybe TRI_STRIPS could be better?)... but this slowdown seems to me too much, if depending only on vertex number... so... is gluSphere composed by glBegin/glEnd calls or not? If so I think it's better for me to create spheres in different ways... :P

Share this post


Link to post
Share on other sites
Advertisement
well if you're only using it for bounding spheres which I would guess would be for debugging does it really matter all that much if you take a bit of a hit?

If it does why not just create a simple sphere model which you could load in instead and store in a vertex array? You could create a function which loads the model and multiplies all the vertices by some scale factor so you could get whatever size you wanted.

Share this post


Link to post
Share on other sites
Or, if you are correct about GLU just encapsulating glBegin/glEnd's then just put it in a display list and call it done. I think part of the problem here is the misconception (yet again) that a drop from 1,000 FPS to 900 FPS is an issue.
The time it takes to render a frame at 1000 FPS is 1 MILLISECOND. The time to render at 900 FPS is 1.1 MILLISECOND. Are you really going to worry about one-tenth of a millisecond?

Share this post


Link to post
Share on other sites
Obviusly the problem was not drawing a bounding sphere, I was worried about the performance hit, since I'm using TAO (with C#)... I thought about creating my sphere model, adjusting it's size when needed, and probably I'll do that following your advice! :D
My only dubt was "why gluSphere is taking so much"?

I was not worried about loosing 100 FPS, I profiled my code tracking down if there were to many state changes... going deeper I found that the slowdown was caused by such a function, so I asked if my thoughts were right (gluQuadric functions don't use vertex arrays or such optimizations)... :P

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!