Following this example using shaders ColorByNormal
combined with the windowToImageFilter I am able to achieve extracting images/screenshots from different viewpoints.
The program works well in a MACOS environment but not in Linux el7.x86_64.
I’m using VTK-9.0. Are there any special options I should be using when compiling VTK in Linux?
How can I make this program work offscreen?
I tried setting vtkRenderWindow::OffScreenRenderingOn() but access the XServer is still needed when executed (I get segfault when running it remotely without ssh -XY option).
When using option -XY I get the following error (the problem is not XServer as I am able to execute other applications)
X Error of failed request: BadValue (integer parameter out of range for operation)
Major opcode of failed request: 149 (GLX)
Minor opcode of failed request: 3 (X_GLXCreateContext)
Value in failed request: 0x0
Serial number of failed request: 52
Current serial number in output stream: 53
When compiling VTK I tried setting the option ‘VTK_USE_X’ to OFF. The error is the same as above.
Another option was to use ‘VTK_OPENGL_HAS_OSMESA’ to ON but this gives the following error.
CMake Error at CMake/vtkModule.cmake:4145 (message):
Could not find the OSMesa external dependency.
Call Stack (most recent call first):
CMake/vtkModule.cmake:4695 (vtk_module_find_package)
Utilities/OpenGL/CMakeLists.txt:49 (vtk_module_third_party_external)
Please help.
Best,