[vtkusers] rendering offscreen

John Shalf jshalf at lbl.gov
Wed Nov 8 14:03:17 EST 2000


Hi,
there are several ways to go about it.  Here is a sampling (there are different trade-offs for
each method).

For Windows Users:
There has been a vtk module in the contrib directory called vtkWin32OffscreenRenderWindow.  It
presumably offers you the offscreen rendering capability for Windows systems.  It may well
take advantage of the 3D graphics hardware (if available).

For Unix/Linux users with software rendering
The vtkRenderWindow can utilize Mesa offscreen rendering methods to render into a memory
buffer without any need for a window.  You must build vtk with the --with-mesa option and have
a copy of mesa around to link to (www.mesa3d.org).  It is enabled using the
SetOffScreenRendering() method of the vtkRenderWindow (or really the vtkOpenGLRenderWindow).

For Unix/Linux with 3D graphics hardware for rendering:
There is a vtkOpenGLOffscreenRenderWindow package at
    http://zeus.ncsa.uiuc.edu/~jshalf/VTK/vtkOffScreen/
If you have an SGI (Impact graphics, Octane, Reality Engine, or Infinite Reality), then you
can use SGI's pbuffers mechanism for accessing the 3D hardware graphics framebuffer directly
without rendering to a window.  So compiling the code with the -DPBUFFERS option will render
with hardware offscreen in that case.  If you have a Sun or HP, or Linux workstation, then you
render offscreen to a pixmap (no window).  Depending on how many polygons you have to draw,
this methodology can be faster than software rendering with mesa, but it will always be slower
by some fraction than rendering to a window because copying the data out of a hardware
framebuffer is always slower than displaying it into a window on screen.  Unfortunately, there
are currently some problems with using texture maps using this approach.  If you need to do
texturemaps, Randy Heiland has provided a patch on his webpage
    http://www.ncsa.uiuc.edu/~heiland/vtk/
(its at the bottom of this page).

After Supercomputing, I need to get together with Randy to create a more comprehensive fix,
but this is what is available right now.

-john


alext at win.tue.nl wrote:

>   Hi all,
>
>   I've got a simple question: which are the mechanisms VTK offers to render
> the 'output' of a vtkRenderer into something offscreen ? Can you use
> vtkRenderers with anything but an on-screen vtkRenderWindow ? What I need is
> to build VTK pipelines that render their output into something like an
> image, not an X or Windows-based window-manager window. The way the image is
> stored is not very important, since I will convert it anyway to my
> application-dependent data. However, the setup of my application forbids
> opening any sort of windows on the screen - so I have to ask vtkRenderer to
> produce its output offscreen somehow. The rest of the VTK pipeline should
> stay unchanged. I'm using vtk 3.1, if this matters.
>
>   Thanks for any suggestions on this,
>
>   Alex Telea
>
> -----------------------------------------------------------------
>  Dr. Alexandru C. Telea      | Technische Universiteit Eindhoven
>                              |
>  E-mail   : alext at win.tue.nl | Dept. of Mathematics and
>  Office   :  HG 7.71         | Computer Science
>  Tel.     : +31 40 247 2749  | PO Box 513
>  Secretary: +31 40 247 4416  | 5600 MB Eindhoven
>  Fax      : +31 40 246 8508  | The Netherlands
>                              |
>  URL      : http://www.win.tue.nl/math/an/alext
> -----------------------------------------------------------------
>
>
>
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers





More information about the vtkusers mailing list