Members - Reputation: 103
Posted 22 May 2012 - 08:13 PM
P.S. sorry if my wording is bad I'm still learning OpenGL and I don't know the terminology very well.
Crossbones+ - Reputation: 12626
Posted 23 May 2012 - 02:27 AM
VBO and IBO are just ways to push your vertex and triangle (indicies) data on the GPU for faster rendering.
Crossbones+ - Reputation: 10522
Posted 23 May 2012 - 03:38 AM
That's not the case at all.
The primary bottleneck when transforming vertexes is - guess what? - transforming vertexes, so it follows that the less of them you have to transform the faster you'll run. Other bottlenecks include the amount of data you need to send from system memory to GPU memory and the number of draw-calls you need to make.
This is where index buffers come in.
Using an index buffer will allow you to be able to remove duplicate vertexes from your object. For 3D hardware a "vertex" here is defined as a completely-specified vertex, including position, normal, texcoords, whatever. A single index is a max of 4 bytes so you're clearly looking to get a tradeoff here where the overhead of extra indexes is lower than the size of the vertexes removed. Even if you don't come out on the right side of that tradeoff (which is unlikely but possible with some meshes) another big advantage is that you can use indexes to concatenate multiple different primitives together. If you're currently drawing a model as a succession of multiple GL_TRIANGLE_STRIP/GL_TRIANGLE_FAN calls then switching to indexing will allow you to draw the entire thing with a single GL_TRIANGLES call, which can translate into large savings.
This has basically been the way things have worked since at least sometime in 1999 - Quake III particularly pushed indexed drawing as the path to optimize for - so it's a well-established pattern that you really don't need to worry about.
It appears that the gentleman thought C++ was extremely difficult and he was overjoyed that the machine was absorbing it; he understood that good C++ is difficult but the best C++ is well-nigh unintelligible.