I compiled and ran the TriangleColoredPoints example (https://vtk.org/Wiki/VTK/Examples/Cxx/PolyData/TriangleColoredPoints) but no render window was displaying and I was getting the following warning: WARN| vtkInteractorStyleSwitchBase (0x5626f82e6430): Warning: Link to vtkInteractionStyle for default style selection.
I added the following code to fix this based on internet sources: #include <vtkAutoInit.h>
VTK_MODULE_INIT(vtkRenderingOpenGL2)
VTK_MODULE_INIT(vtkInteractionStyle)
The render window now displays but the output is messed up as you can see in the following image.
If the camera is rotated a bit, the following output is displayed:
What could be the cause of this? I have the same issue with different polydata as well. I am using VTK 9.0.0 on Ubuntu 20.04.2 LTS. I also tested this with the latest commit from master.
EDIT:
I also tested the newer ColoredPoints example (https://lorensen.github.io/VTKExamples/site/Cxx/PolyData/ColoredPoints/) and added the following in my CMakeLists.txt file instead of using the VTK_MODULE_INIT macros.
vtk_module_autoinit(
TARGETS example
MODULES ${VTK_LIBRARIES}
)
I got the following output:
This is my OpenGL info:
OpenGL vendor string: nouveau
OpenGL renderer string: NV124
OpenGL core profile version string: 4.3 (Core Profile) Mesa 20.2.6
OpenGL core profile shading language version string: 4.30
GPU: GTX 970
The new VTK Examples site is vtk-examples and the examples corresponding to those no longer maintained ones are: TriangleColoredPoints and ColoredPoints. These render perfectly well using VTK 9.0 and the NVIDIA drivers in both Windows and Linux. Also the CMakeLists.txt files should need no modifications.
I can confirm it works with the latest Nvidia driver. I also tried reinstalling the Nouveau driver and the issue persisted. Is the default Nouveau driver not supported?
When I modified the CMakeLists file I included the below snippet, which is present in the new examples, but not the old ones:
vtk_module_autoinit(
TARGETS TriangleColoredPoints
MODULES ${VTK_LIBRARIES}
)
I might be wrong but I suspect that not all the features of the NVidia cards are emulated by Nouveau. You will get far better performance using the NVidia drivers e.g. NVIDIA/Nouveau vs. NVIDIA Linux Driver
Most likely this is true. The strange thing is that ParaView 5.8.0 works just fine with the Nouveau driver, so it is a little odd VTK had an issue. Doesn’t ParaView use the VTK rendering features? Maybe a different (older?) VTK version is currently used by it.