-
VBO tips and tricks
Posted on 15 September 2009 Neill No commentsUntil now, the moment I took some of the stereotypes about how to draw the geometry means OpenGL, which after a series of tests had to be overcome.
My first stereotype was formed about 7 years ago when I represented the geometry in the form of triangles strips related to increase productivity. I used the library ACTC – http://www.plunk.org/ ~ grantham / public / actc /
Today, I decided to measure the speed of the output triangles strips and regular triangles and received in the second case, the increase up to five times! Apparently this is connected with the fact that connected triangles are much more challenges with glDrawElements, but these calls are very expensive.
My second stereotype with the same time to use the function glInterleaved, in fact, to date, much faster to use function glPointer ***
Also I would like to share advice on the usage of an index buffer and the glDrawElements call.
There was a situation – I have a big index buffer. I take pieces of it to draw with glDrawElements, hence there is a need to specify the data offset in the buffer. So when we say that a variable “unsigned int offset” contains a value in bytes of the offset, we need not to put the pointer to this variable in glDrawElements, we need to simply cast variable type like this:glDrawElements(…, …, …, (GLvoid*) offset );
Graphics, Programming C++, OpenGL, Tips, VBOLeave a Reply
You must be logged in to post a comment.


English
Russian
Recent Comments