What is the best method to copy pixels from texture to texture?
I've found some ways to accomplish this.
For instance, there's a method glCopyImageSubData()
but my target version is OpenGL 2.1, so I cannot use it.
Also, because the performance is very important, glGetTexImage2D()
is not an option.
Since I'm handling video frames as texture, I have to make copies about 30~60 times per second.
Available options which I found are next:
- create fbo for source texture and copy it to destination texture using glCopyTexSubImage2D().
- create fbos for source and destination textures and blit the fbos.
- create fbo for destination texture and render source texture to fbo.
You can ignore the cost of creation of fbo because fbo will be created only once.
Please just don't post something like 'it depends. do your benchmark.'. I'm not targeting only one GPU. If it depends, please, please let me know how it depends on what.
Furthermore, because it is very difficult to measure timing of OpenGL calls, what I want to know it not a quantitative result. I need some advices about which method I should avoid.
If you know better method to copy textures, please let me know it too.
Thank you for reading.