Page MenuHomePhabricator

Clean up open GL context after VTK rendering
Closed, ResolvedPublic


MITK supports rendering with both openGL and VTK. However, VTK does ensure a "clean" (or regular) openGL context after rendering. It takes some effort to ensure a clean openGL context after VTK rendering.

Today, in the weekly MITK meeting we decided to try to wrap our openGL mappers with the VTK mapper concept. This will result in a unified mapping concept for MITK/VTK and we can get rid of switching between different contexts.

I will make a list of the MITK openGL mappers to wrap and try to figure out which openGL policy/guideline VTK uses for coding new mappers.

Event Timeline

I discussed this with Matthias and he guessed that there is no official VTK guideline for custom mappers. The best way would be to look about the example implementations of the vtkMapper interfaces, like vtkOpenGLPolyDataMapper, etc..

For cleaning up the context he proposed to look into several vtkWidgets which make use of different VTK mappers, and thus, have to clean up the context.

Resetting all bugs without active assignee flag to "CONFIRMED". Change status to IN_PROGRESS if you are working on it.

This bug should also refactor the following methods in the mitkVtkPropRenderer:
-OpenGL commands inside Render()

Due to its severity, this bug is considered relevant for the upcoming 2012.09 release.

Please check the status and consider fixing this bug for 2012.09.

I think Sebastian worked on this. The status was more or less "we can't do more right now". I asked him to write his findings down, but he couldn't do it yet.

@Sebastian: Do you remember the status of this bug?

In our current implementation, the openGL context is in a clean state after our custom GL rendering.

No changes are required.

There is an ugly workaround for this bug in the mitkVtkProprenderer.cpp:212 which causes a bug in MES because there the glGetFloatv/boolean is not available. A Cleaner solution would be to disable Texturing in Enable2DOpenGL like it is done with the lightning there.

Re-opend the bug.

New remote branch pushed: bug-8188-cleaupglcontext

This bug has a 18 month history. Please write change request / summary before requesting the flag.

Revisited it with Markus F. Changes are Ok.

[6e7c6c]: Merge branch 'bug-8188-cleaupglcontext'

Merged commits:

2013-01-09 14:08:13 Eric Heim [37273f]
added comments in changes

2013-01-02 14:17:17 Eric Heim [632fbd]
removed the workaround for T8188 in mitkVtkProprenderer.cpp:212 and added cleaner solution in Enable2DOpenGL