1

I'm trying to implement the triple buffering described here http://developer.apple.com/library/ios/#documentation/3ddrawing/conceptual/opengles_programmingguide/OpenGLESApplicationDesign/OpenGLESApplicationDesign.html. The intend is to gain higher frame rate by avoiding waiting for glBufferSubData to finish.

My understanding is that this is how to implement triple buffer:

- make 3 buffers with glGenBuffers()
Current frame:
  - bind to buffer3
  - draw last frame
  - bind to buffer1
  - glBufferSubData for all the vertices, 
      keep track of their texture/vertex count,blend function, etc
Next frame:
  - bind to buffer 1
  - draw last frame (bind texture, blend func, glDrawArrays)
  - and so on

There doesn't seem to be any performance gain between this and doing glBufferSubData then immediately call glDrawArrays.

Am I missing something or misunderstand how triple buffer should work?

Also is there a way to know when glDrawArrays stall due to glBufferSubData still not finished?

  • `double` is a data type. What language are you using? Note that, within the context of computer graphics, double-buffering will not necessarily improve speed; it is a way to prevent tearing or flickering artifacts. See https://en.wikipedia.org/wiki/Multiple_buffering – Robert Harvey Jun 17 '13 at 14:42
  • I'm using C++/Objective C, our target platform is windows/ios/andriod, but right now just trying to get it to work on windows – user2493559 Jun 17 '13 at 14:57
  • Read the Wikipedia article I linked, especially Section 1.1. – Robert Harvey Jun 17 '13 at 15:06

0 Answers0