Jump to content
  • Advertisement
Sign in to follow this  
CyberSlag5k

Using glDrawRangeElements by sorting, not splittiing, models of differing materials

This topic is 4947 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 had originally planned on splitting up my models into groups based on the materials of their surfaces (or can materials be split up by vertex?). However, I'm thinking perhaps I don't have to. I'll just sort the polygons by materials and then keep an array of structures (or hell even a class) that holds the position of the material change in the index list and the material properties themselves. So I could do something like this:
for(int i = 0; i < matList.getSize(); i++)
{
matList.setMaterials();
glDrawRangeElements(GL_TRIANGLES, matList.getStartPos(), matList.getEndPos(), numPolygons, indexList);
}


Does that look good? Or is making multiple calls to glDrawRangeELements going to kill the efficiency I recieve from it?

Share this post


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

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