Glitches when passing from QVTKWidget to QVTKOpenGLWidget

Hi,

There’s this project I’m using in one of my company’s product https://github.com/OpenGeoscience/vtkMap it’s a slippy map.

In applications/weatherstations, there’s an example of a Qt application using that project. A QVTKWidget is used to display the map :

https://discourse.paraview.org/uploads/default/original/2X/b/b0fd44e3cbff508f856f953d325fc4673870f8fe.png

I changed the QVTKWidget / vtkRenderWindow by a QVTKOpenGLWidget / vtkGenericOpenGLRenderWindow and everything is glitchy : https://discourse.paraview.org/uploads/default/original/2X/d/d6bcc6535c625e125148c2965a7ab81beee6aef2.png

I didn’t forget to add this before QApplication :
QSurfaceFormat::setDefaultFormat(QVTKOpenGLNativeWidget::defaultFormat());

I compiled the application under 3 different systems (Windows 8, KUbuntu and Centos 7) with different GPUs and the result is always the same (glitchs or the map tiles are not displayed).

When using that project in a program where ParaView is embedded, there’s no glitchs with QVTKOpenGLWidget (see : https://discourse.paraview.org/t/paraview-opengl-version/4065).

So, I believe there’s a cure for these glitches but I didn’t find it !

Setting surface format is just part of the story. Qt/VTK application initialization steps are very delicate - you need to perform all the steps and in the correct order. I would recommend to copy the steps from large projects, such as Paraview, because several developers worked very hard on getting those right and they are tested by thousands of users on various platforms.

Hi @lassoan

I did, but I still have glitches ! Do you know which version of VTK ParaView 5.4.1 is based ? I didn’t find that info. I want to build that VTK version and try with vtkMap, because when I’m using the VTK classes from ParaView 5.4.1 libraries I don’t have glitches in vtkMap.

Thanks.

You can ask such details about Paraview on their forum.

ParaView doesn’t track a VTK release, but a commit on the master branch at some point. 5.4.1 uses VTK commit a9b132548dc19b8e20898b424b31cafacbf39246.

1 Like

Thank you very much @cory.quammen

With the same code (weather stations Qt example from vtkMap) :

With VTK 8.0.0.rc1-54-ga9b1325 (the one used in ParaView 5.4.1), there’s no glitches :

wsmap_vtk_8_0_0

With VTK 8.2.0 (I initialized the QSurface properly)
wsmap_vtk_8_2_0

With the latest VTK from master (using QVTKOpenGLStereoWidget and QVTKRenderWindowAdapter::defaultFormat to initialize the QSurfaceFormat’s default format)

I managed to have this result by playing with the camera (possible with 8.2.0 too)
wsmap_vtk_master

but this is the first result :
wsmap_vtk_master_2

Otherwise, without using Qt (X11 window ?), there’s no glitches with all the versions.