Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 1

Qt-interest Archive, April 2008
QTOpenGL QGLPixelBuffer / QGLFramebufferObject


Message 1 in thread

Hi all,

I'm interested in programming code processing images in openGL, in 
particular rendering in memory (off-screen).
I'm interested in running my program in linux, but I want be able to run 
it in windows.

I have been trying QGLPixelBuffer / QGLFramebufferObject. And I have 
some questions about them.

1 .- With some cards/drivers pbuffer/fbuffer not currently supported, 
why? it's a hardware dependence or driver?

2.- There is any way to render in memory with QT without pbuffer/fbuffer?
 
3.- Can I do to render in memory without hardward rendering in a 
"compatible mode" when there isn't pbuffer/fbuffer support? To be more 
compatible in linux could pbuffer/fbuffer work with xorg vesa driver?

4 .- What is more effective QGLPixelBuffer / QGLFramebufferObject?



thanks

--
 [ signature omitted ] 

Message 2 in thread

On Apr 3, 2008, at 6:54 AM, JOSEP wrote:

> I'm interested in programming code processing images in openGL, in  
> particular rendering in memory (off-screen).
> I'm interested in running my program in linux, but I want be able  
> to run it in windows.
>
> I have been trying QGLPixelBuffer / QGLFramebufferObject. And I  
> have some questions about them.
>
> 1 .- With some cards/drivers pbuffer/fbuffer not currently  
> supported, why? it's a hardware dependence or driver?

Old versions of OpenGL did not define pbuffers or fbos. Its just an  
OpenGL version thing.

> 2.- There is any way to render in memory with QT without pbuffer/ 
> fbuffer?

What are you trying to do? You can render to offscreen buffers with  
Qt's native painter, and it can probably do the image processing that  
you want.

> 3.- Can I do to render in memory without hardward rendering in a  
> "compatible mode" when there isn't pbuffer/fbuffer support? To be  
> more compatible in linux could pbuffer/fbuffer work with xorg vesa  
> driver?

Perhaps, but without hardware rendering, IMO you are better off using  
Qt instead. You should first try to do what you want in Qt, and see  
if performance is acceptable. If so, you are done. Only try to  
optimize when you know where you need more performance.

> 4 .- What is more effective QGLPixelBuffer / QGLFramebufferObject?

In general, fbos are faster than pbuffers due to how they are defined  
in the OpenGL specification. However, I've used both, and my speed  
differences were minimal in my application.

Brad




-- 
 [ signature omitted ] 

Message 3 in thread

Brad Howes escribió:
> On Apr 3, 2008, at 6:54 AM, JOSEP wrote:
>> I'm interested in programming code processing images in openGL, in 
>> particular rendering in memory (off-screen).
>> I'm interested in running my program in linux, but I want be able to 
>> run it in windows.
>>
>> I have been trying QGLPixelBuffer / QGLFramebufferObject. And I have 
>> some questions about them.
>>
>> 1 .- With some cards/drivers pbuffer/fbuffer not currently supported, 
>> why? it's a hardware dependence or driver?
>
> Old versions of OpenGL did not define pbuffers or fbos. Its just an 
> OpenGL version thing.
>
>> 2.- There is any way to render in memory with QT without pbuffer/fbuffer?
>
> What are you trying to do? You can render to offscreen buffers with 
> Qt's native painter, and it can probably do the image processing that 
> you want.
>
>> 3.- Can I do to render in memory without hardward rendering in a 
>> "compatible mode" when there isn't pbuffer/fbuffer support? To be 
>> more compatible in linux could pbuffer/fbuffer work with xorg vesa 
>> driver?
>
> Perhaps, but without hardware rendering, IMO you are better off using 
> Qt instead. You should first try to do what you want in Qt, and see if 
> performance is acceptable. If so, you are done. Only try to optimize 
> when you know where you need more performance.
>
>> 4 .- What is more effective QGLPixelBuffer / QGLFramebufferObject?
>
> In general, fbos are faster than pbuffers due to how they are defined 
> in the OpenGL specification. However, I've used both, and my speed 
> differences were minimal in my application.
>
> Brad
>
>
>
>
> -- 
> Brad Howes
> Group 42
> MIT Lincoln Laboratory • 244 Wood St. • Lexington, MA 02173
> Phone: 781.981.5292 • Fax: 781.981.3495 • Secretary: 781.981.7420
>
>
>
>
I'll explain better.

I'm trying to port a Win32 aplication that use Windows API and OpenGL to QT.
The aplication has all the rendering code coded in OpenGL.
I only need a offscreen rendering context to render in it with the 
openGL code that my aplication have.

I thing in QT only are QGLPixelBuffer or QGLFramebufferObject to render 
offscreen, I'm wrong?

The problem is that I'm experimenting that my hardware/software/driver 
(i don't know?) don't support openGL pbuffer/fbuffer.

I'm using Debian Sid, it have an old openGL version? or openGL version 
depends on hardware? or depends on the X server version?

thanks


Message 4 in thread

On Thu, 03 Apr 2008 21:08:44 +0200, JOSEP <jbort@xxxxxxxxxxx> wrote:

> I'll explain better.
>
> I'm trying to port a Win32 aplication that use Windows API and OpenGL to  
> QT.
> The aplication has all the rendering code coded in OpenGL.
> I only need a offscreen rendering context to render in it with the  
> openGL code that my aplication have.
>
> I thing in QT only are QGLPixelBuffer or QGLFramebufferObject to render  
> offscreen, I'm wrong?
>
> The problem is that I'm experimenting that my hardware/software/driver  
> (i don't know?) don't support openGL pbuffer/fbuffer.
>
> I'm using Debian Sid, it have an old openGL version? or openGL version  
> depends on hardware? or depends on the X server version?
>
> thanks

There is always the option of rendering to the framebuffer, using  
glCopyTexSubImage2D to transfer the framebuffer data to a texture, and  
finally clearing the framebuffer. This was the common way to do  
render-to-texture before FBOs and PBOs were available.

Samuel

--
 [ signature omitted ] 

Message 5 in thread

El Thursday 03 April 2008 12:54:23 JOSEP va escriure:
> Hi all,
>
> I'm interested in programming code processing images in openGL, in
> particular rendering in memory (off-screen).
> I'm interested in running my program in linux, but I want be able to run
> it in windows.
>
> I have been trying QGLPixelBuffer / QGLFramebufferObject. And I have
> some questions about them.
>
> 1 .- With some cards/drivers pbuffer/fbuffer not currently supported,
> why? it's a hardware dependence or driver?
>
> 2.- There is any way to render in memory with QT without pbuffer/fbuffer?
>
> 3.- Can I do to render in memory without hardward rendering in a
> "compatible mode" when there isn't pbuffer/fbuffer support? To be more
> compatible in linux could pbuffer/fbuffer work with xorg vesa driver?
>
> 4 .- What is more effective QGLPixelBuffer / QGLFramebufferObject?
>
>
>
> thanks
>
> --
> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with
> "unsubscribe" in the subject or the body. List archive and information:
> http://lists.trolltech.com/qt-interest/

I'm testing a simple aplication in some computers.

Laptop core2 duo - graph card Intel - driver intel - libGL.so from mesa. NO 
pbuffer /NO fbuffer

PC P4 - graph S3 chrome - driver VESA- libGL.so from mesa . NO pbuffer /NO 
fbuffer

PC AMD Opteron 4600+ - graph Nvidia quadro - driver Nvidia legacy- libGL.so 
from NVIDIA. All work pbuffer and fbuffer

The Xorg.conf file is similar in all cases.

Now my problem is that i don't know where will be pbuffer/fbuffer suported, in 
the hardware, the xorg driver or the version of libGL.so.

Anyone knows it?

thanks

Attachment:

Attachment: signature.asc
Description: This is a digitally signed message part.


Message 6 in thread

See QGLWidget documentation: You can just say:

        QGLFormat fmt;
        fmt.setDirectRendering(false);
        QGLWidget* glW = new QGLWidget(fmt, 0);

And you'll have an indirect rendering (=offscreen) GL context.

Derive a QGLWidget, implement the method paint, and then
        renderPixmap(width, height).toImage();

will give you a QImage that you can save to a png for example.

Benjamin.

ps: hola upc



On Fri, Apr 4, 2008 at 9:01 AM, Josep <jbort@xxxxxxxxxxx> wrote:
> El Thursday 03 April 2008 12:54:23 JOSEP va escriure:
>
>
> > Hi all,
>  >
>  > I'm interested in programming code processing images in openGL, in
>  > particular rendering in memory (off-screen).
>  > I'm interested in running my program in linux, but I want be able to run
>  > it in windows.
>  >
>  > I have been trying QGLPixelBuffer / QGLFramebufferObject. And I have
>  > some questions about them.
>  >
>  > 1 .- With some cards/drivers pbuffer/fbuffer not currently supported,
>  > why? it's a hardware dependence or driver?
>  >
>  > 2.- There is any way to render in memory with QT without pbuffer/fbuffer?
>  >
>  > 3.- Can I do to render in memory without hardward rendering in a
>  > "compatible mode" when there isn't pbuffer/fbuffer support? To be more
>  > compatible in linux could pbuffer/fbuffer work with xorg vesa driver?
>  >
>  > 4 .- What is more effective QGLPixelBuffer / QGLFramebufferObject?
>  >
>  >
>  >
>  > thanks
>  >
>  > --
>  > To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with
>  > "unsubscribe" in the subject or the body. List archive and information:
>  > http://lists.trolltech.com/qt-interest/
>
>  I'm testing a simple aplication in some computers.
>
>  Laptop core2 duo - graph card Intel - driver intel - libGL.so from mesa. NO
>  pbuffer /NO fbuffer
>
>  PC P4 - graph S3 chrome - driver VESA- libGL.so from mesa . NO pbuffer /NO
>  fbuffer
>
>  PC AMD Opteron 4600+ - graph Nvidia quadro - driver Nvidia legacy- libGL.so
>  from NVIDIA. All work pbuffer and fbuffer
>
>  The Xorg.conf file is similar in all cases.
>
>  Now my problem is that i don't know where will be pbuffer/fbuffer suported, in
>  the hardware, the xorg driver or the version of libGL.so.
>
>  Anyone knows it?
>
>  thanks
>

--
 [ signature omitted ]