Jump to content
  • Advertisement
Sign in to follow this  

optimizing rendering for different textures

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

how much of an optimization would it be to render a world consisting of many triangles to have them ordered so as to group them by the texture they are using, i.e. so i can bind a texture, glBegin(GL_TRIANGLES); render all triangles using this texture, then again for next texture so as to minimize calls to glBegin and glEnd? if i render to a display list and then simply call the display list, would it still be a valid optimization?

Share this post


Link to post
Share on other sites
Advertisement
Limiting state changes, so texture/shader changes (as you describe as your first optimization) is a really good way of speeding things up.
Another way is to abandon immediate mode (the glBegin/glEnd construction) for vertex buffers and index buffers, since that way vertex data needs not to be uploaded to the video card every frame.
When using vertex buffers, a third good way to speed up rendering is batching: rendering large amounts of vertices using one call. To be able to do that, you indeed need to sort by texture/shader.

The creation of display lists takes quite some time. So, using display lists is a not-too-bad optimization given the little work it takes to implement, but only for static geometry.

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!