![]() It will reduce the number of API calls by orders of magnitude, and avoid any data copying as long as the vertex data does not change over time. Making the move to VBOs is of course the real solution. This would be glVertex3fv() for float vectors. You could also use the version of the glVertex*() call that takes a single argument with a pointer to the vector, instead of 3 separate arguments. ![]() I suspect that you could get a significant performance improvement even with using the deprecated immediate mode calls if you started using float for all your coordinates (both your own storage, and for passing them to OpenGL). And since the OpenGL vertex pipeline operates in single precision (*), the driver will have to convert all the values to float. That doubles the amount of data that needs to be passed around compared to using float values. One important aspect that makes this much worse than it needs to be: You're using double values for your coordinates. State management and logic in the driver code.Looping and array accesses in your own code. ![]() That's a lot! For each of these calls, you'll have: With 50,000 triangles, and 3 API calls per triangle, this is 150,000 API calls per frame, or 9 million API calls/second if you're targeting 60 frames/second. So there's no need for a lot of kernel calls, and the data for each vertex is certainly not sent to the GPU separately.ĭriver overhead is most likely the main culprit.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |