Strange and erratic transformations when using OpenGL VBOs to render scene

Posted by janoside on Game Development See other posts from Game Development or by janoside
Published on 2012-03-18T20:38:04Z Indexed on 2012/03/19 2:17 UTC
Read the original article Hit count: 297

Filed under:
|

I have an existing iOS game with fairly simple scenes (all textured quads) and I'm using Apple's "Texture2D" class. I'm trying to convert this class to use VBOs since the vertices of my objects basically never change so I may as well not re-create them for every object every frame.

I have the scene rendering using VBOs but the sizes and orientations of all rendered objects are strange and erratic - though locations seem generally correct. I've been toying with this code for a few days now, and I've found something odd: if I re-create all of my VBOs each frame, everything looks correct, even though I'm almost certain my vertices are not changing.

Other notes

  • I'm basing my work on this tutorial, and therefore am also using "IBOs"
  • I create my buffers before rendering begins
  • My buffers include vertex and texture data
  • I'm using OpenGL ES 1.1
  • Fearing some strange effect of the current matrix GL state at the time of buffer creation I've also tried wrapping my buffer-setup code in a "pushMatrix->loadIdentity->popMatrix" block which (as expected) had no effect
  • I'm aware that various articles have been published demonstrating that VBOs may not help performance, but I want to understand this problem and at least have the option to use them.

I realize this is a shot in the dark, but has anyone else experienced this type of strange behavior? What might I be doing to result in this behavior?

It's rather difficult for me to isolate the problem since I'm working in an existing, moderately complex project, so suggestions about how to approach the problem are also quite welcome.

© Game Development or respective owner

Related posts about ios

Related posts about vbo