Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: Force image slice actors to be treated as opaque #586

Closed
wants to merge 1 commit into from
Closed

BUG: Force image slice actors to be treated as opaque #586

wants to merge 1 commit into from

Conversation

msmolens
Copy link
Member

This commit fixes rendering of image slices in the 3D view with the VTK
OpenGL2 backend.

The OpenGL2 backend performs more thorough checks than the old backend
when determining whether to treat an actor as opaque or translucent.
Now, in certain cases, VTK determines that the slice texture contains
transparent elements and therefore should treat the actor as
translucent, i.e. rendered without writing to the depth buffer. [1][2]

This commit overrides that transparency-detection logic to force the
image slice actors to be treated as opaque.

Fixes http:https://www.na-mic.org/Bug/view.php?id=4253

[1] https://github.com/Kitware/VTK/blob/bace0bcf81dd6e8d334b78add2d77da37d71398f/Rendering/Core/vtkActor.cxx#L131-L133

[2] https://github.com/Kitware/VTK/blob/bace0bcf81dd6e8d334b78add2d77da37d71398f/Rendering/OpenGL2/vtkOpenGLActor.cxx#L59

This commit fixes rendering of image slices in the 3D view with the VTK
OpenGL2 backend.

The OpenGL2 backend performs more thorough checks than the old backend
when determining whether to treat an actor as opaque or translucent.
Now, in certain cases, VTK determines that the slice texture contains
transparent elements and therefore should treat the actor as
translucent, i.e. rendered without writing to the depth buffer. [1][2]

This commit overrides that transparency-detection logic to force the
image slice actors to be treated as opaque.

Fixes http:https://www.na-mic.org/Bug/view.php?id=4253

[1] https://github.com/Kitware/VTK/blob/bace0bcf81dd6e8d334b78add2d77da37d71398f/Rendering/Core/vtkActor.cxx#L131-L133

[2] https://github.com/Kitware/VTK/blob/bace0bcf81dd6e8d334b78add2d77da37d71398f/Rendering/OpenGL2/vtkOpenGLActor.cxx#L59
Copy link
Member

@jcfr jcfr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice 👍

I just tested on Ubuntu 15.10 / Quadro M2000M and it works great.

Please integrate to svn asap.

@msmolens
Copy link
Member Author

Integrated in r25394

@msmolens msmolens closed this Sep 26, 2016
@msmolens msmolens deleted the 4253-image-slice-rendering-opengl2 branch September 26, 2016 13:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants