Jump to content
  • Advertisement


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


Material/state sorting for scene-graph-like scenes

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

My problem is the following: I have a scene that is divided into entities, where each entity has a location and orientation (rotation), and might have sub-entities with their own location and orientation relative to their parent. I am trying to implement a sorted renderlist so that all things with a specific texture or a specific state (lighting, blending, etc) get drawn in a batch (to reduce state switching). This does complicate the matrix management considerably, or rather, makes it less efficient because instead of going down a node in the tree and rendering all of it in the correct place by incrementally adjusting the modelview matrix, I now have to store an absolute matrix for every entity so that I can draw it outside of its tree context (and there are *lots* of little objects in my scenes, think leaves on trees). Question is - is this really more efficient than switing texture and state a lot? I have not been able to compare the performance of both schemes yet because I am too lazy to implement the new scheme before someone assures me that it will really help. On a related note: What would be more efficient - calculating my own transformation matrices for each object and uploading them to openGL, or going through the tree from the root up for each object using openGL's matrix functions? I'm guessing the first is better since i can still exploit the tree structure of the data when calculating the matrices (that happens while normally traversing the tree, at the sorting pass)... [edited by - marijnh on March 21, 2004 1:32:16 PM]

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!