Jump to content
  • Advertisement
Sign in to follow this  

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

This topic is 5024 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++)
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
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!