[vtkusers] Combined on-screen and off-screen possible with VTK-7.0.0 on linux/X?
Sophonet
vtk12af6bc42 at kant.sophonet.de
Fri Jan 15 06:44:38 EST 2016
Dear list,
in my application, I would like to display a vtkRenderWindow for user
interaction, but I also would like to use off-screen functionality
simultaneously to render pre-defined views / snapshots that are shown as
static images, like "thumbnails" for different datasets.
This was possible in VTK 5.10 on linux (by creating a dedicated
vtkRenderWindow per thumbnail, setting OffScreenRenderingOn, rendering
and capturing the resulting image with a vtkWindowToImageFilter).
In VTK-7.0.0.rc1, using the OpenGL rendering backend on Mesa 9.2.3, I
now get a segfault with the following backtrace:
(gdb) bt
#0 0x00007fffd045db90 in xcb_glx_get_string_string_length ()
from /usr/lib64/libxcb-glx.so.0
#1 0x00007fffd0cce605 in ?? () from /usr/lib64/libGL.so.1
#2 0x00007fffd0ccc2b6 in ?? () from /usr/lib64/libGL.so.1
#3 0x00007fffd14cd086 in
vtkOpenGLExtensionManager::ReadOpenGLExtensions() ()
from
/import/QUINTA/non-public/software/linux-install/quinta_gcc_debug/lib/libvtkRenderingOpenGL-7.0.so.1
#4 0x00007fffd14cbd50 in vtkOpenGLExtensionManager::Update() ()
from
/import/QUINTA/non-public/software/linux-install/quinta_gcc_debug/lib/libvtkRenderingOpenGL-7.0.so.1
#5 0x00007fffd14cafd7 in
vtkOpenGLExtensionManager::ExtensionSupported(char const*) ()
from
/import/QUINTA/non-public/software/linux-install/quinta_gcc_debug/lib/libvtkRenderingOpenGL-7.0.so.1
#6 0x00007fffd14ec8ea in vtkOpenGLRenderWindow::OpenGLInitContext() ()
from
/import/QUINTA/non-public/software/linux-install/quinta_gcc_debug/lib/libvtkRenderingOpenGL-7.0.so.1
#7 0x00007fffd14eae6d in vtkOpenGLRenderWindow::OpenGLInit() ()
from
/import/QUINTA/non-public/software/linux-install/quinta_gcc_debug/lib/libvtkRenderingOpenGL-7.0.so.1
#8 0x00007fffd1576932 in
vtkXOpenGLRenderWindow::CreateOffScreenWindow(int, int) ()
Besides a remark that probably there could be better error handling than
just letting the app crash without an exception being thrown, I would
like to know if joint on-screen rendering and off-screen rendering is
still possible somehow with VTK-7.0.0.
I have made two approaches when configuring via CMake: (i) Setting
VTK_OPENGL_HAS_OSMESA=True (no effect, I think I remember that in
earlier versions, this allowed OSMESA_INCLUDE_DIR etc. to be set; this
is not the case anymore, so does this flag still do something? Note that
for VTK 5.10 as mentioned above I did not have to set this explicitly),
(ii) Setting USE_OFFSXCREEN_EGL=True - resulting in an error that this
could not be combined with VTK_USE_X.
On Windows, combining on-screen and off-screen rendering as described in
the second paragraph is possible.
Any suggestions would be welcome, the Wiki page I have found on this
topic is not fully understandable to me
(http://www.vtk.org/Wiki/VTK/OSMesa_Support; does this mean that I have
to switch on VTK_OPENGL_HAS_OSMESA or not?...)
Thanks,
sophonet
More information about the vtkusers
mailing list