[vtk-developers] GLXPixmap vs OSMesa

John Shalf jshalf at lbl.gov
Thu Mar 10 18:01:00 EST 2005


On Mar 10, 2005, at 2:49 PM, Jeff Lee wrote:
> Moreland, Kenneth wrote:
>> Jeff,
>> I like the idea of the UseOffScreenRendering flag working without 
>> Mesa.
>> However, we also often use Mesa builds on clusters that do not have 
>> an X
>> host running.  I think using GLXPixmap still requires a connection to 
>> an
>> X host.  Thus if you stripped out the Mesa stuff, our applications may
>> cease to work.  Could you implement this such that if you build with
>> Mesa you use Mesa offscreen rendering and otherwise use a GLXPixmap?
>>
> Hi Kenneth,
> I was under the impression that mesa has its own glx implementation - 
> fakeglx.  I could be wrong, but I think it just turns everything into 
> X.  I was hoping that if an application uses mesa, the fakeglx 
> implementation of glxPixmap would just work (mapping down to Pixmap).  
> I think pbuffers will work the same way.  Does this make sense?  If 
> not, mabey someone could straighten me out on this.

I think Ken is right.  The mangled Mesa writes directly to an osmesa 
(offscreen mesa) context, thereby completely circumventing X11.  The 
'osmesa' context is purely a feature of Mesa -- not something you would 
see in a standard OpenGL 1.3 implementation.   Unfortunately, osmesa 
also leaves you without the benefit of hardware accelerated rendering. 
Both the glxPixmap and the pbuffers require an XServer to be running -- 
in the latter case, pbuffers seems to depend primarily on X11 security 
to mediate access to the framebuffer.  I believe the people at Tungsten 
Graphics are working on a way to leverage Chromium to do hardware 
accelerated offscreen rendering without X11 getting in the way (kudos 
to them if it works).

Regardless, it would be nice to have hardware accelerated offscreen 
rendering capability available for people who *do* run an xserver on 
the render nodes of their cluster. So, it would be very cool if the 
pbuffers/glxpixmap stuff gets into the mainstream VTK releases.  
However, Mangled Mesa will need to stay there for people who are not 
running their XServers.

-john

>>> -----Original Message-----
>>> From: vtk-developers-bounces at vtk.org 
>>> [mailto:vtk-developers-bounces at vtk.org] On Behalf Of Jeff Lee
>>> Sent: Thursday, March 10, 2005 3:02 PM
>>> To: vtk-developers
>>> Subject: [vtk-developers] GLXPixmap vs OSMesa
>>>
>>> Hi All,
>>> I have been tooling around with glpixap for offscreen rendering.  I 
>>> started with vtkXOpenGLRenderWindow and managed to strip out the 
>>> osmesa stuff and replace its implementation with rendering to a 
>>> glxpixmap instead (a'la John Schalf and Glenn Lehmann).  All of this 
>>> works great, all I have to do is call SetOffScreenRendering(1) on 
>>> the renderWindow, and then I can dump the image to a file.  
>>> Eventually I can have it such that switching between 
>>> onscreen/offscreen will work similar to windows.  I can also see a 
>>> pbuffer implementation as a straightforward extension of this.
>>>
>>> The question is, can anyone see any major drawbacks of dropping 
>>> osmesa for this approach?  The benefits that I can see are;
>>>
>>>   1. No more mangled mesa, this approach (glxPixmap)  works both in
>>>      mesa and in hardware drivers.
>>>   2. We can stop tiling the display to get high-resolution images.
>>>   3. Similar behavior to that of vtkWin32OpenGLRenderWindow.
>>>   4. Can further extend to hardware-accelerated pbuffers with drivers
>>>      that support it.
>>>
>>> Possible Drawbacks:
>>>
>>>   1. Perhaps not everyone has a driver which supports glx1.3.
>>>   2. glxpixmap is slow (not when compared to osmesa).
>>>
>>> I would like to eventually replace what's in vtkXOpenGLRenderWindow 
>>> with glxpixmap.  Does anyone have other arguments which I am perhaps 
>>> not seeing, or reasons for not doing this?  Thanks in advance.
>>> Regards,
>>> Jeff
>>>
>>> --
>>> Jeff Lee
>>> Senior Software Engineer
>>> Computational Dynamics North America Ltd
>>> 21 Lafayette Street, Suite 230
>>> Lebanon NH 03766 USA
>>> fax:   603 643 9994
>>> phone: 603 643 9993 x109
>>> http://www.cd-adapco.com
>>>
>>> _______________________________________________
>>> vtk-developers mailing list
>>> vtk-developers at vtk.org
>>> http://www.vtk.org/mailman/listinfo/vtk-developers
>>>
>>>
>>>
>>
>> _______________________________________________
>> vtk-developers mailing list
>> vtk-developers at vtk.org
>> http://www.vtk.org/mailman/listinfo/vtk-developers
>>
>>
>>
>
>
> _______________________________________________
> vtk-developers mailing list
> vtk-developers at vtk.org
> http://www.vtk.org/mailman/listinfo/vtk-developers




More information about the vtk-developers mailing list