Sign in to follow this  

optimizing rendering for different textures

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

This topic is 3859 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this