Skip to content

Fix initialization of the depth test state with QVTKOpenGLNativeWidget

Qt provides a context where the depth test is disabled by default. In general, vtkRenderer will take care of enabling the dept test in its Clear() method at the beguining of the render call, but there are use cases where the depth test is expected to be enabled before VTK renders:

  1. If vtkRenderer::EraseOff() was called, Clear() won't be called and the depth test is left disabled
  2. Render passes that restores the depth test initial value (e.g. vtkSSAOPass) will restore a disabled depth test for additional overlay renderers that could use EraseOff to prevent useless clearing.

Fixes Slicer/Slicer#7518

Co-authored by: @lassoan

Merge request reports