Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

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.

share|improve this question
1  
Can you post your initialization/draw code? It's a little difficult to say exactly what would cause this behavior without seeing it. –  K.G. Mar 19 '12 at 15:54
    
Could be the values you use for glDrawElements are getting over written or otherwise changed... Shot in the dark answer for a shot in the dark question I guess :) –  Byte56 Mar 19 '12 at 19:09

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.