I need to render quite alot (tens of thousands) images off-screen using OpenGL.
I am running under Windows and using QT as a framework. the solution can be windows only, it doesn't really matter.
From what I've found using Google there are a number of options for doing this This article which seems rather dated suggest a few ways, out of which the relevant ones are:
CreateDIBSection
and somehow bind the texture to it.This thread (Message 6) suggests a QT specific way of doing this using QGLWidget::renderPixmap
My question is - which one would be the fastest way? pbuffers seems to be the safest bet because it is guaranteed to be performed on the hardware but isn't using the CreateDIB method also goes through the hardware? What about the QT method? there seem to be some context-creation issue with this one. surely I would not want to create a new context for every image I create.
Does any one has some good experience with this?
EDIT: Answering the comment -
I have a constant scene which doesn't change at all and I'm rendering it from many different viewpoints. For now the images go back to the user and will be processed by the CPU. Possibly in the future they are going to be processed on the GPU.
Use FBO. It's fast, portable and much nicer to use than pbuffers.
EDIT: For best performance, alternate rendering between two different FBOs:
This way you can be reading back one FBO and then processing it while the GPU renders to the other one in parallel.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With