[vtkusers] Off screen rendering Linux, OpenGL accelerated

Lasso Andras andraslasso at gmail.com
Thu Mar 12 19:22:43 EDT 2009


Hi Anton,

We use VTK 5.2 for hardware-accelerated off-screen rendering on 64-bit
linux, with nVidia card.

The vtkOpenGLRenderWindow::CreateHardwareOffScreenWindow method had to
be changed to get hardware acceleration (maybe due to that the Mesa
library was also installed on the workstation), it may work for you as
well:

Change this line:
  int isMesa=substring!=0;
to:
  int isMesa=0;

VTK was built was VTK_OPENGL_HAS_OSMESA=OFF.

To make sure that nVidia libraries are used, you may check the loaded
shared libraries (especially libGL*) by cat /proc/<pid>/maps

Andras


On Tue, Mar 10, 2009 at 5:20 PM, Anton Deguet <anton.deguet at jhu.edu>
wrote:
> Hello,
>
> I would like to know if there is an easy way to render off screen on
Linux
> (X) with OpenGL (NVidia accelerated).
> My code looks like:
>
> ?vtkRenderWindow *pOffScreenRenderWindow =
vtkOpenGLRenderWindow::New();
> ?pOffScreenRenderWindow->OffScreenRenderingOn();
>
> This works on Windows (at least XP, VS 2008, VTK 5.2) and Mac OS
(10.5, gcc
> 4, VTK 5.0). ?I tried all kind of combinations on Linux (CentOS,
Ubuntu
> 8.04, VTK 5.0, 5.2, 5.3) and it fails.
>
> Is there any reason this doesn't work? ?Is there a magic method to
call or
> build configuration needed?
>
>
> Anton
>
>
> PS: I also did a bit of research and found the class
> vtkXOpenGLOffScreenRenderWindow
(http://www.cmake.org/Wiki/VTK_Classes).
> ?With some minor updates I got this class to compile and run on Linux
64
> (amd) with VTK 5.2. ?The method ReportCapabilities() lists NVIDIA as
the
> OpenGL vendor. ?It would be nice if whatever is implemented in this
external
> class could make it to VTK.
>
> ---
> Anton Deguet, Research Engineer, ERC-CISST/LCSR, Johns Hopkins
University
> e-mail: anton.deguet at jhu.edu, iChat: anton.deguet at mac.com
> office phone: 410-516-5261, cell phone: 410-790-0456
> JHU, LCSR, CSEB 137b, 3400 North Charles Street, Baltimore, MD 21218,
USA
>
>





More information about the vtkusers mailing list