[vtkusers] Issues with QVTKOpenGLWidget and VTK8.2
Geoff Woodcock
geoff.woodcock at velo3d.com
Tue Mar 19 15:59:42 EDT 2019
Hi,
We have an application based on Qt and Vtk. It runs well on VTK8.1 However, after upgrading to VTK8.2, we experience problems when we first call vtkRenderer::Render(). This call ultimately ends up calling vtkOpenGLState::CheckState, and this fuction emits a lot of error messages which are listed below.
I understand that the vtkOpenGLState is not initialized properly, but I can't seem to figure out what the proper order of initialization is supposed to be. I am calling QSurfaceFormat::setDefaultFormat() before creating my QApplication object. The render window initialization is pretty straightforward:
_vtkWidget = new QVTKOpenGLWidget((QWidget *)nullptr);
_vtkWidget->setEnableHiDPI(true);
// VTK Renderer
_renderer = vtkSmartPointer<vtkRenderer>::New();
_renderer->SetLayer(0);
_rendererOverlay = vtkSmartPointer<vtkRenderer>::New();
_rendererOverlay->SetLayer(1);
// VTK/Qt wedded
vtkNew<vtkGenericOpenGLRenderWindow> renderWindow;
_qvtkWidget>SetRenderWindow(renderWindow);
renderWindow->SetNumberOfLayers(2);
renderWindow->AddRenderer(_renderer);
renderWindow->AddRenderer(_rendererOverlay);
The vtkOpenGLState::Initialize function is never called
I have tried switching from QVTKOpenGLWidget to QVTKOpenGLNativeWidget, which fixes the state initialization problems (but I am unable to use it, since it causes problems with line drawing as documented here: https://gitlab.kitware.com/vtk/vtk/issues/17154).
So the code works with 8.1 and also works with QVTKOpenGLNativeWidget.
Can someone help me understand what I am doing wrong with the initialization?
Generic Warning: In d:\projects\flow-2\tools\conan\thirdparty\build\libvtk\rendering\opengl2\vtkopenglstate.cxx, line 95
Error in cache state for GL_DEPTH_WRITEMASK
Generic Warning: In d:\projects\flow-2\tools\conan\thirdparty\build\libvtk\rendering\opengl2\vtkopenglstate.cxx, line 106
Error in cache state for GL_COLOR_WRITEMASK
Generic Warning: In d:\projects\flow-2\tools\conan\thirdparty\build\libvtk\rendering\opengl2\vtkopenglstate.cxx, line 124
Error in cache state for GL_CULL_FACE
Generic Warning: In d:\projects\flow-2\tools\conan\thirdparty\build\libvtk\rendering\opengl2\vtkopenglstate.cxx, line 131
Error in cache state for GL_MULTISAMPLE
Generic Warning: In d:\projects\flow-2\tools\conan\thirdparty\build\libvtk\rendering\opengl2\vtkopenglstate.cxx, line 144
Error in cache state for GL_STENCIL_TEST
Generic Warning: In d:\projects\flow-2\tools\conan\thirdparty\build\libvtk\rendering\opengl2\vtkopenglstate.cxx, line 162
Error in cache state for GL_VIEWPORT
Generic Warning: In d:\projects\flow-2\tools\conan\thirdparty\build\libvtk\rendering\opengl2\vtkopenglstate.cxx, line 173
Error in cache state for GL_SCISSOR_BOX
Generic Warning: In d:\projects\flow-2\tools\conan\thirdparty\build\libvtk\rendering\opengl2\vtkopenglstate.cxx, line 179
Error in cache state for GL_CULL_FACE_MODE
Generic Warning: In d:\projects\flow-2\tools\conan\thirdparty\build\libvtk\rendering\opengl2\vtkopenglstate.cxx, line 185
Error in cache state for GL_DEPTH_FUNC
Generic Warning: In d:\projects\flow-2\tools\conan\thirdparty\build\libvtk\rendering\opengl2\vtkopenglstate.cxx, line 191
Error in cache state for GL_BLEND_SRC_RGB
Generic Warning: In d:\projects\flow-2\tools\conan\thirdparty\build\libvtk\rendering\opengl2\vtkopenglstate.cxx, line 197
Error in cache state for GL_BLEND_SRC_ALPHA
Generic Warning: In d:\projects\flow-2\tools\conan\thirdparty\build\libvtk\rendering\opengl2\vtkopenglstate.cxx, line 203
Error in cache state for GL_BLEND_DST_RGB
Generic Warning: In d:\projects\flow-2\tools\conan\thirdparty\build\libvtk\rendering\opengl2\vtkopenglstate.cxx, line 209
Error in cache state for GL_BLEND_DST_ALPHA
Generic Warning: In d:\projects\flow-2\tools\conan\thirdparty\build\libvtk\rendering\opengl2\vtkopenglstate.cxx, line 222
Error in cache state for GL_COLOR_CLEAR_VALUE
CONFIDENTIALITY NOTICE:This message (including any attachments) may contain confidential, proprietary, privileged and/or private information. If you are not the intended recipient of this message, please notify the sender immediately, and delete the message and any attachments. Any disclosure, reproduction, distribution or other use of this message or any attachments by an individual or entity other than the intended recipient is prohibited
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://vtk.org/pipermail/vtkusers/attachments/20190319/978f8485/attachment.html>
More information about the vtkusers
mailing list