Sign in to follow this  

how slow is slow?

Recommended Posts

Uthman    485
so I know glVertexPointer is a 'slow' call (as opposed to glVertex3f, but considering glVertex3f would have to be called a gazillion times compared to the once glVertexPointer is where we get our speed. anyhow, how slow is 'slow'? Im trying to optimize my custom file format which, for now, issues: one glVertexPointer call one glTexCoordPointer call and one glNormalPointer call per mesh per model. is this okay or is it not good enough?

Share this post

Link to post
Share on other sites
Optus    422
Profiling would be a good idea indeed. In my program glVertexPointer is the heaviest of the pointer calls, but you should find that glDrawArrays/DrawElements/etc are much heavier.

Beyond that, it depends on how you are going to use your model format. Your current method would be good for props or animated characters. For a level model though, there is possibly going to be 100s of meshes within a model.

The ideal setup is to have a single set of vertices, texcoords, normals, etc for an entire model. I would choose to ignore the whole concept of user-defined "meshes" (Only for engine purposes, not for modelling, obviously). Sort the geometry by texture, and you end up with the least amount of calls possible.

rendering would then be:
one glVertexPointer/glTexCoordPointer/glNormalPointer
and one glDrawArrays/Elements call for each texture used by the model.

Share this post

Link to post
Share on other sites

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