Sign in to follow this  

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

This topic is 4662 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[i].getSize(); i++)
{
matList[i].setMaterials();
glDrawRangeElements(GL_TRIANGLES, matList[i].getStartPos(), matList[i].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

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