[vtkusers] VTK Offscreen Rendering

Simon Drouin drouin.simon at gmail.com
Wed Apr 15 20:39:11 EDT 2009


I use vtkRenderLargeImage (which renders large images by succesively
rendering small portions of it)  that connects to a vtkRenderer and produce
a vtkImageData as an output, that can then be saved to a file using
something like vtkPNGWriter.

I have 2 problems with that method though.

1 - With volume rendering, I get 1 pixel wide lines at the separation of the
blocks (I suspect it is a bug in vtkRayCastImageDisplayHelper)
2 - When rendering animation, I need to create a new vtkRenderLargeImage
everytime I change frame otherwise, it vtkRenderLargeImage always outputs
the same frame even though the scene is changing.
3 - There doesn't seem to be a way to avoid displaying a render window on
the screen (at least it is the case on OSX with VTK built on COCOA). I have
tried to set OffScreenRenderingOn on the window right after it is
constructed (before any render occurs) and it is still showing the window.

s.

On Wed, Apr 15, 2009 at 3:51 PM, Kevin H. Hobbs <hobbsk at ohiou.edu> wrote:

> On Wed, 2009-03-25 at 21:57 -0400, Shari Rolnick wrote:
> > I’ve been using VTK with mangled Mesa to create offscreen
> > visualizations for some time, but from glancing through the more
> > recent documentation and mailing list archives, it looks like that is
> > no longer the preferred method, but I couldn’t figure out how to make
> > offscreen rendering work otherwise.  In addition, it looks like (for
> > example) the vtkAxesActor does not work with mangled Mesa.  (The
> > actors don’t show up in images that are generated offscreen.)  Could
> > someone either direct me to an example or instructions for the “right”
> > way to do offscreen rendering now, or tell me how I might get the
> > vtkAxesActor working with mangled Mesa?
> >
> >
> >
> > Thanks,
> > Shari
>
> The right way is to just build mesa and mesa's offscreen library osmesa.
>
> Then tell cmake to link VTK with mesa and osmesa.
>
> My CMakeCache.txt has these settings:
>
> VTK_OPENGL_HAS_OSMESA:BOOL=ON
> OPENGL_INCLUDE_DIR:PATH=/home/kevin/mesa/include
> OPENGL_gl_LIBRARY:FILEPATH=/home/kevin/mesa/lib64/libGL.so
> OPENGL_glu_LIBRARY:FILEPATH=/home/kevin/mesa/lib64/libGLU.so
> OSMESA_INCLUDE_DIR:PATH=/home/kevin/mesa/include
> OSMESA_LIBRARY:FILEPATH=/home/kevin/mesa/lib64/libOSMesa.so
>
> You can set them in ccmake to point to your own mesa build or set only
> VTK_OPENGL_HAS_OSMESA and set the environment variables
> CMAKE_LIBRARY_PATH and CMAKE_INCLUDE_PATH such that cmake finds files
> from mesa before system files and graphics libraries from ati or nvidia.
>
> Your operating system may provide mesa and osmesa.
>
> You may have to build two copies of VTK, one to use libraries from ati
> or nvidia and one to do offscreen rendering.
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20090415/3cbef685/attachment.htm>


More information about the vtkusers mailing list