Qt5 branch - MacOS transparency issue

Built MacOS 10.12.6 off fresh support-qt5-2017-08-11-r26241 branch. Built fine, runs fine (overall).

Graphics card is AMD Radeon R9 M370 on MacBook Pro Retina 15" on external thunderbolt display.

When displaying 3D model (from “Create surface”), there are transparency artifacts when displaying surfaces with 0.5 opacity. Should this be working properly with OpenGL 2 and VTK 8?

I can provide a video of the issue if needed.

Thanks!

-Hollister

To get correct transparency, you need to enable depth peeling in menu: Edit / Application settings / Views / 3D viewer defaults / Use depth peeling - then restart Slicer.

While it can impact performances in some scenario, I wonder if we should enable depth peeling by default …

2 Likes

Yes, we should enable it by default when we switch to the OpenGL2 backend.

The performance decrease with the OpenGL backend was significant and at some point the feature stopped working (at least on Windows), so it made no sense to enable it by default for the old backend.

Issue still occurs with depth peeling activated. (Same as recent nightly build, incidentally.)

Is the Qt5 branch set to use OpenGL 2 by default? Slicer_VTK_RENDERING_BACKEND is set to OpenGL2, I’d been assuming that was all I needed to do. Qt version is 5.9.1.

Let me know if you want a video of the issue.

I’ve just tried and for me, enabling depth peeling fixes transparent polygon rendering (Windows, OpenGL2 backend, Qt 5.6). Note that you have to rebuild VTK from scratch if you switch to another rendering backend - a forced rebuild may not be enough.

The version of VTK will default to 8 if Qt5_DIR is used to configure Slicer.

That said, if you set Qt5_DIR in an already configured build tree … it will not force the version of VTK.

https://github.com/Slicer/Slicer/blob/ee5c8703642cf8f42e9594bc780cb0801623b39d/CMakeLists.txt#L310-L319

https://github.com/Slicer/Slicer/blob/ee5c8703642cf8f42e9594bc780cb0801623b39d/CMakeLists.txt#L546-L553