Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


order of operations...

This topic is 5937 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 was going to implement a sorted rendering engine for my project. All the static objects that need to be rendered the same way every frame are going to have all their properties dumped into a listed data structure. I was wondering what opperations should have sorted prefrences, I know that doesn''t make any sence so I''ll give an example. List of Polygons Indicies - Color - Textured? - Texture ID - UV - Blended? - Alpha Basicly what I''m asking is what states are the most proscessor intensive to change and should be changed the least frequently. For example, if changing enabling 2D Texturing took the longest time to compleate then I would make a sorted list of all the objects with 2D textures...then all without...so for each frame you only have 2 state changes...then the next hardest task was selecting the actual texture, so I sort the subsets of data and then change to each texture once for all the polys that need it. Hard Med Easy Easy Easy Med Easy Easy Easy Med Hard Med Easy Easy Easy Med Easy Easy Easy Med Easy Easy Easy So the least effort needs to go into rendering the most objects, see? Has anyone measured the time it takes to change each of the states? Is there a diffrence? Thanks, duckbob

Share this post

Link to post
Share on other sites
glBindTexture calls are expensive, and are usually pretty frequent, so it's a good idea to minimise those. glColor calls are cheap, as are glTexCoord and glVertex calls. (although performance can be improved through the use of vertex arrays and/or display lists). As for other operations, I suggest you do your own testing.


[edited by - benjamin bunny on August 13, 2002 11:54:45 PM]

Share this post

Link to post
Share on other sites
yes binding textures is the slowest (usually)
basically what i do (ignoring blending shaders)
before anythings drawn (in the precompilation of the scene)
*build a list of every pass in the scene (multiple passes added together is a shader)
a pass is a combination of multiple things eg textureID, alpha test enabled etc
*each pass has an ID number
*these get sorted before the scene starts (of course its impossible to get a perfect sort, using texture IDs only is good enuf)
*during the scene no sorting of textures is done (only sorting is meshes from front to back)

though if youre begining a project or opengl i wouldnt worry to much about all this.


Share this post

Link to post
Share on other sites

  • 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!