Fem: Partial transparency fix in FemPostObject display modes #12918
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request is an attempt to fix #6996:
The transparency type used by the scene graph is
SORTED_OBJECT_SORTED_TRIANGLE_BLEND
. This transparency mode works well with polygons using aSoMaterial
with multiple colors but does not handle points and lines correctly: In this mode with transparency enabled, lines and points are rendered using only the first color in the color array (current behavior) .According to the Coin documentation, these objects should be passed in the
SORTED_OBJECT_BLEND
mode, but in order to be effectively drawn with transparency respecting the color array, it is necessary to enable this mode explicitly, for example, by using aSoTransparencyType
object within the shape separator.Doing that still doesn't work correctly because the order on the screen doesn't respect the z-value of the shape elements (the back lines and dots are rendered on top of the front objects seemingly randomly). (see figure 1).
The shapes are drawn in the correct order if the transparency mode is
BLEND
(fig. 2), but the problem with this mode is that if there is another shape behind the transparent object, the background color is visible (fig. 3).To mitigate this issue, the buffer depth test is disabled if the object is completely transparent.
Another unreported issue is fixed with the first commit.
Currently it is necessary to activate the backlight to work with Fem Pipeline objects.
This occurs because the nodes of the Fem mesh are exported to the VTK array in wrong order (nodes of the SMSH elements do not respect the same order as the VTK cells points).
Sorting the nodes correctly fixes this problem and the backlight is no longer necessary.
fig1.
fig2.
fig3.