Page MenuHomePhabricator

Blending problem when rendering not fully opaque meshes
Closed, InvalidPublic


The 3D visualization of models seems to be broken since MITK 2014.03 when showing objects with opacity.

Some of the error seem to fixed when activating "depth sorting" in the data node property but this is only a visualization fix for a single item. Having multiple items drawn the depth perception is totally incorrect. Objects that are further away from the viewer look closer to the camera than others. Additionally some triangles are displayed transparent, other don't.

load vtk or stl file
load binary image and generate polygon model (normal/smoothed)
move 3D view and observe incorrectly displayed triangles in surface mode.

The visualization shows broken triangles in the Mesh. Also the depth perception seems to be wrong when loading multiple objects. This can be observed when moving the objects over each other.

Also sometimes the first surface side does vanish.

Attached you find 2 teeth. Best load both together and set transparency to 50% to perceive the face and depth problem.

Event Timeline

Dear Florian,

thank you for reporting this bug. For me, it seems like that the layer property has also influence in the 3D rendering window, which shouldn't be the case.

You are right, depth sorting works only within non-opaque objects but not with multiple objects in the scene. This is a general limitation of this approach.

However, we provide another option for correct transparency rendering when using the Standard Multi Widget, which might be helpful for you. The option can be found in the "Window" > "Preferences..." menu.
Select "Editor" > "Standard Multi Widget" and chose "Enable Depth Peeling" in the Rendering Mode drop down menu. Then restart MITK and load your surfaces and change the opacity.

We tried the depth peeling approach with the vtk tooth surfaces you provided and it worked.


Changed status to WORKSFORME.

There are two issues here, which work with correct settings:

(1) Intra-object transparency
You must either enable the depth sorting property or depth peeling in the preferences.

(2) Inter-object transparency
If you are using the depth sorting property you have to ensure that objects in the front have a higher layer (property) than objects in the back. This is a feature (not a bug) but it is not done automatically. Note that this approach cannot work in all cases for overlapping objects (see Painter's algorithm). You can change the layer of an object either by directly changing the layer property or by changing the order of the data nodes in the Data Manager, i.e., via drag and drop. I will attach a screenshot to prove that it's working.

A more robust and convenient approach is to simply enable depth peeling, which also works for inter-object transparency regardless of the layer and which dosn't have the Painter's algorithm flaw. I will also attach a screenshot of the preferences setting.

Enabled depth sorting for both surfaces and set higher layer for front surface.

dephsorting-plus-layer.JPG (384×611 px, 24 KB)

kislinsk changed the task status from Invalid to Spite.Jun 27 2018, 1:30 PM
kislinsk added a project: Bulk Edit.
kislinsk changed the task status from Spite to Invalid.Jun 27 2018, 1:36 PM
kislinsk removed a project: Bulk Edit.