• Advertisement
Sign in to follow this  

Textured sphere

This topic is 3953 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

I'm using the following code to draw a textured ball. And i'm drawing multiple balls like this one. This code is too slow...Even when i remove the textures... It seems like the gluSphere(QuadObj, BALL_RADIUS, BALL_SLICES, BALL_STACKS) is the slow part... What should i do? What is the most efficient way to draw a textured sphere? Thanks David gluQuadricOrientation(QuadObj, GLU_OUTSIDE); gluQuadricDrawstyle(QuadObj, GLU_FILL); gluQuadricNormals(QuadObj, GLU_SMOOTH); gluQuadricTexture(QuadObj, GL_TRUE); glEnable(GL_TEXTURE_2D); glBindTexture(GL_TEXTURE_2D, currentBallTexture); gluSphere(QuadObj, BALL_RADIUS, BALL_SLICES, BALL_STACKS); glDisable(GL_TEXTURE_2D);

Share this post


Link to post
Share on other sites
Advertisement
What are the values of BALL_SLICES and BALL_STACKS?
It could be that your spheres are really heavily/needlessly tessellated.

Regards,
ViLiO

Share this post


Link to post
Share on other sites
Have you got 'culling' enabled ?

glEnable(GL_CULL_FACE);

[wink]


is the following outside of the render loop also ??
Put it in the scene INIT, unless you need to change these for some reason.

gluQuadricOrientation(QuadObj, GLU_OUTSIDE);
gluQuadricDrawstyle(QuadObj, GLU_FILL);
gluQuadricNormals(QuadObj, GLU_SMOOTH);
gluQuadricTexture(QuadObj, GL_TRUE);

Share this post


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

  • Advertisement