Page MenuHomePhabricator

Change VTK rendering backend to OpenGL2
Closed, ResolvedPublic

Description

todos:

  • vtk coordinate differences, 2D Overlays are "stuck"
  • NevertranslucentTexture deleted, image transparency is not working properly

Revisions and Commits

Related Objects

Event Timeline

  • OpenViewCore not compiling yet

User kolbch has pushed new remote branch:

bug-18922-OpenGL2VTKRenderingBackend

User kolbch has pushed new remote branch:

bug-18922-OpenGL2BackendVTK7

User kolbch has pushed new remote branch:

bug-18922-OpenGL2BackendMigration

User kolbch has pushed new remote branch:

bug-18922-OpenGL2BackendNewVersion

@kolbch @kirchnth Do you guys talk to each other on this topic?

@kolbch If necessary, for experiments:

Report from the users list

We saw that the branch T18922-OpenGLBackend2-kislinsk-2 was using OpenGL2, so we built this branch and used it in our application. Everything is working fine, except for one thing: planar figures are not displayed. Control points are displayed as they are defined, but they disappear right away, and the polyline is not displayed.

@kolbch will work on this soon-ish.

kolbch added a revision: Restricted Differential Revision.Aug 8 2017, 12:47 AM
  • I'll remove SOFA and MitkSimulation as it is still based on a rather old version anyway. If we want to have simulations again, we have to make sure that SOFA doesn't use the fixed-function pipeline anymore resp. contribute to SOFA.
  • VMTK doesn't work anymore but I saw a recent commit in their repo stating to make it compatible to VTK 8.0.
  • The ViewportRendering tests fail.

Removed GLEW, VMTK, and SOFA in the branch T18922-OpenGL2Backend-Final. Will upgrade to VTK 8.

@kolbch Did you adapt the LegacyGL module as it is still used? What about the rendering tests?

There are still some mappers deriving from GLMapper. But I don't know if/where they are used. Maybe in MITK-MBI?

In the Viewport tests, PlanarFigures are not rendered in the correct position. I will have a look...

OpenViewCore and GPGPU build again.

Had to fix a few remaining parsing errors (commented unsused parameters were interpreted as unmatched end of comments). Successfully ran rendering tests. Merged into master. Continuous dartclients run from scratch at the moment.

Both continuous dart clients are red, start working on build errors...

Rendering tests on our Windows continuous dart clients don't work anymore. Probably because "modern" OpenGL is not supported. Typical test outputs:

ERROR: In D:\dc\bin\ep\src\VTK\Rendering\OpenGL2\vtkWin32OpenGLRenderWindow.cxx, line 653
vtkWin32OpenGLRenderWindow (0000000002E401F0): failed to get wglChoosePixelFormatARB

ERROR: In D:\dc\bin\ep\src\VTK\Rendering\OpenGL2\vtkWin32OpenGLRenderWindow.cxx, line 737
vtkWin32OpenGLRenderWindow (0000000002E401F0): failed to get valid pixel format.

ERROR: In D:\dc\bin\ep\src\VTK\Rendering\OpenGL2\vtkOpenGLRenderWindow.cxx, line 816
vtkWin32OpenGLRenderWindow (0000000002E401F0): GLEW could not be initialized.

ERROR: In D:\dc\bin\ep\src\VTK\Rendering\OpenGL2\vtkOpenGLRenderWindow.cxx, line 1858
vtkWin32OpenGLRenderWindow (0000000002E401F0): Hardware does not support the number of textures defined.

Had to remove OpenViewCore and QmlItems modules. These modules are not compatible to the OpenGL2 backend. GLEW and QOpenGLFunctions are incompatible as well.

Removed the OpenViewCore/QmlItems examples.

Rendering tests on our Windows continuous dart clients don't work anymore. Probably because "modern" OpenGL is not supported. Typical test outputs:

ERROR: In D:\dc\bin\ep\src\VTK\Rendering\OpenGL2\vtkWin32OpenGLRenderWindow.cxx, line 653
vtkWin32OpenGLRenderWindow (0000000002E401F0): failed to get wglChoosePixelFormatARB

ERROR: In D:\dc\bin\ep\src\VTK\Rendering\OpenGL2\vtkWin32OpenGLRenderWindow.cxx, line 737
vtkWin32OpenGLRenderWindow (0000000002E401F0): failed to get valid pixel format.

ERROR: In D:\dc\bin\ep\src\VTK\Rendering\OpenGL2\vtkOpenGLRenderWindow.cxx, line 816
vtkWin32OpenGLRenderWindow (0000000002E401F0): GLEW could not be initialized.

ERROR: In D:\dc\bin\ep\src\VTK\Rendering\OpenGL2\vtkOpenGLRenderWindow.cxx, line 1858
vtkWin32OpenGLRenderWindow (0000000002E401F0): Hardware does not support the number of textures defined.

Equal problems for our Ubuntu continuous dart client:

ERROR: In /home/mbiuser/mitkdc/MITK-sb-R-c/ep/src/VTK/Rendering/OpenGL2/vtkTextureObject.cxx, line 1627
vtkTextureObject (0x24ae6f0): Failed to determine texture parameters. IF=0 F=6408 T=5121

ERROR: In /home/mbiuser/mitkdc/MITK-sb-R-c/ep/src/VTK/Rendering/OpenGL2/vtkShaderProgram.cxx, line 424
vtkShaderProgram (0x24b0fc0): 0:39(12): error: extension `GL_EXT_gpu_shader4' unsupported in fragment shader

GLSL __VERSION__ is 120.

Okay, I close this task and we should open separate tasks for future issues. Thanks again @kolbch and @goerres.

Had to remove OpenViewCore and QmlItems modules. These modules are not compatible to the OpenGL2 backend. GLEW and QOpenGLFunctions are incompatible as well.

@kislinsk @kolbch @goerres : This change looks very relevant to me as I am currently using those modules in an external project.

Did you look a little into this incompatibility and could elaborate a bit? Did you have a deeper look into what work would be required to get those modules working again? Any of your insights would be welcome.. (be it just for future reference in case I or anybody need to get a Qml example working with a current version of MITK)

I think @maleike isn't the only one how played around with that code and deprecating/disabling it would have been a bit nicer, but we had to focus our resources on the Workbench and core MITK for now. I hope we will get T23294 working again till the next release and appreciate any support!

Had to remove OpenViewCore and QmlItems modules. These modules are not compatible to the OpenGL2 backend. GLEW and QOpenGLFunctions are incompatible as well.

@kislinsk @kolbch @goerres : This change looks very relevant to me as I am currently using those modules in an external project.

Did you look a little into this incompatibility and could elaborate a bit? Did you have a deeper look into what work would be required to get those modules working again? Any of your insights would be welcome.. (be it just for future reference in case I or anybody need to get a Qml example working with a current version of MITK)

Hey Daniel, no worries. It wasn't meant to be banned from MITK. I even had to remove my baby MITK Simulation to get things up and running again in short time. Our resources are too limited at the moment to work on these kind of things but we're happy for any contributions that enable us to reactivate these modules. I didn't spent much time to find an alternative solution so you might be able to fix this quickly. The basic problem is that you can't include QOpenGLFunctions after you included GLEW but the otherway around didn't work, too. So the solution probably is to find a way to either include both, or to implement the feature with only one of these technologies. Any contribution is highly appreciated.

T23294: Create a working QML example using the OpenGL2 backend

Hey Daniel, no worries. It wasn't meant to be banned from MITK. I even had to remove my baby MITK Simulation to get things up and running

Thanks for this information, this might become very helpful! And no worries, I do not have Qml baby feelings anymore ;-)
I hope I'll be able to allocate some time to contribute to T23294 soon.

Deleted branch T18922-OpenGLBackendRebase.

Deleted branch T18922-OpenGLBackendRebase2.