View Issue Details

IDProjectCategoryView StatusLast Update
0004253Slicer4Core: Renderingpublic2016-09-27 10:33
Reporterlassoan Assigned Tojcfr  
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
Product VersionSlicer 4.6.0 
Target VersionFixed in Version 
Summary0004253: VTK rendering corrupted with VTK OpenGL2 rendering backend
Description

When VTK OpenGL2 rendering backend is used, image slices appear in 3D viewer incorrectly.

A. Depth-peeling disabled
Only a part of the slice is visible, a slice completely overlaps another, while it should be partially cover it, etc.

Tested on a Surface book with NVidia GPU. Behavior is the same if used with Intel and NVidia GPU.

B. Depth-peeling enabled

Only a part of the slice is visible, some colored noise appears in the viewer.

Tested on a Surface book with NVidia GPU. Behavior is only reproducible with with Intel GPU. Rendering is correct if the application is set to use NVidia GPU.

Steps To Reproduce
  • Start Slicer
  • Load MRHead
  • Link slice views, show slices in 3D
TagsNo tags attached.

Activities

lassoan

lassoan

2016-09-10 16:40

developer  

DepthPeelingOff2.png (1,306,541 bytes)
DepthPeelingOff2.png (1,306,541 bytes)
lassoan

lassoan

2016-09-10 16:40

developer  

DepthPeelingOn2.png (398,158 bytes)
DepthPeelingOn2.png (398,158 bytes)
lassoan

lassoan

2016-09-10 16:41

developer  

RenderingCorruptionOpenGL2.mp4 (3,109,533 bytes)
lassoan

lassoan

2016-09-10 16:52

developer   ~0014086

Tested on a desktop PC with NVidia card: rendering is corrupted with depth-peeling disabled (A), rendering is correct with depth-peeling enabled (B).

lassoan

lassoan

2016-09-10 19:04

developer   ~0014087

Last edited: 2016-09-10 19:12

View 2 revisions

If texture interpolation is turned off, then display is correct.

for snName in ['Red Volume Slice', 'Green Volume Slice', 'Yellow Volume Slice']:
getNode(snName).GetDisplayNode().SetInterpolateTexture(0)

msmolens

msmolens

2016-09-20 18:35

developer   ~0014107

I took a look at scenario A. In the OpenGL2 backend the actors for the slices are not rendering into the depth buffer (i.e. glDepthMask(GL_FALSE)) because GetIsOpaque() returns false; see https://github.com/Kitware/VTK/blob/94dfcdac64c2e987155b216d39e6049fa1206e4b/Rendering/OpenGL2/vtkOpenGLActor.cxx#L59

In the OpenGL backend this code checked whether the actor's property's opacity == 1.0.

As a test, in the debugger, it looks like forcing those actors to be opaque (vtkActor::ForceOpaque) fixes the rendering.

Without verifying, the difference seen when disabling texture interpolation can probably be explained by the checks in https://github.com/Kitware/VTK/blob/94dfcdac64c2e987155b216d39e6049fa1206e4b/Rendering/Core/vtkTexture.cxx#L260

msmolens

msmolens

2016-09-27 09:44

developer   ~0014132

For reference, this was fixed in https://github.com/Slicer/Slicer/pull/586 / http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&revision=25394

lassoan

lassoan

2016-09-27 10:33

developer   ~0014133

I've tested this and it works well on NVidia and Intel GPUs, too. Thank you!

Issue History

Date Modified Username Field Change
2016-09-10 16:38 lassoan New Issue
2016-09-10 16:38 lassoan Status new => assigned
2016-09-10 16:38 lassoan Assigned To => jcfr
2016-09-10 16:40 lassoan File Added: DepthPeelingOff2.png
2016-09-10 16:40 lassoan File Added: DepthPeelingOn2.png
2016-09-10 16:41 lassoan File Added: RenderingCorruptionOpenGL2.mp4
2016-09-10 16:52 lassoan Note Added: 0014086
2016-09-10 19:04 lassoan Note Added: 0014087
2016-09-10 19:12 lassoan Note Edited: 0014087 View Revisions
2016-09-20 18:35 msmolens Note Added: 0014107
2016-09-27 09:44 msmolens Note Added: 0014132
2016-09-27 09:44 msmolens Status assigned => resolved
2016-09-27 09:44 msmolens Resolution open => fixed
2016-09-27 10:33 lassoan Note Added: 0014133