Gui: Add hidden anchor object to root for transparency#26590
Gui: Add hidden anchor object to root for transparency#26590kadet1090 merged 2 commits intoFreeCAD:mainfrom
Conversation
|
We have the same issue with other planar geometry - like for example planes. Would it be possible to add element like that to the root of 3D scene instead? |
Image planes with transparency failed to render correctly in empty scenes because OpenInventor's two-pass transparency rendering requires at least one opaque object to properly initialize the depth buffer. The fix adds a zero-scaled cube with no material node (making it use OpenGL's default opaque material) to each image plane's scene graph. This hidden object: - Acts as a depth buffer anchor for transparent rendering - Is invisible (scaled to 0,0,0) - Has negligible performance impact This matches the workaround already used in the rotation center indicator and resolves the issue where image transparency only worked when the rotation center, grid, or other opaque objects were visible.
d8ba6f8 to
df7bb7c
Compare
|
@kadet1090 sure, done. Along this change I also tested issue that Max linked me, thx @maxwxyz (#15192) and it looks like this patch resolves this as well. |
|
Does it impact bounding box calculation? It is some geometry placed in the scene so it might affect stuff like "fit all" etc. |
Prevents the hidden anchor from affecting "fit all" and other bounding box operations by wrapping it in `SoSkipBoundingGroup`.
|
@kadet1090 good catch, didn't even think about that. Yes, turns out it was prone to |
* Gui: Add hidden anchor object to the root for transparency Image planes with transparency failed to render correctly in empty scenes because OpenInventor's two-pass transparency rendering requires at least one opaque object to properly initialize the depth buffer. The fix adds a zero-scaled cube with no material node (making it use OpenGL's default opaque material) to each image plane's scene graph. This hidden object: - Acts as a depth buffer anchor for transparent rendering - Is invisible (scaled to 0,0,0) - Has negligible performance impact This matches the workaround already used in the rotation center indicator and resolves the issue where image transparency only worked when the rotation center, grid, or other opaque objects were visible. * Gui: Exclude hidden anchor from bounding box calculations Prevents the hidden anchor from affecting "fit all" and other bounding box operations by wrapping it in `SoSkipBoundingGroup`. (cherry picked from commit 3f49f3f)
|
Successfully created backport PR for |
* Gui: Add hidden anchor object to the root for transparency Image planes with transparency failed to render correctly in empty scenes because OpenInventor's two-pass transparency rendering requires at least one opaque object to properly initialize the depth buffer. The fix adds a zero-scaled cube with no material node (making it use OpenGL's default opaque material) to each image plane's scene graph. This hidden object: - Acts as a depth buffer anchor for transparent rendering - Is invisible (scaled to 0,0,0) - Has negligible performance impact This matches the workaround already used in the rotation center indicator and resolves the issue where image transparency only worked when the rotation center, grid, or other opaque objects were visible. * Gui: Exclude hidden anchor from bounding box calculations Prevents the hidden anchor from affecting "fit all" and other bounding box operations by wrapping it in `SoSkipBoundingGroup`. (cherry picked from commit 3f49f3f)
Image planes with transparency failed to render correctly in empty scenes because OpenInventor's two-pass transparency rendering requires at least one opaque object to properly initialize the depth buffer.
The fix adds a zero-scaled cube with no material node (making it use OpenGL's default opaque material) to each image plane's scene graph. This hidden object:
This matches the workaround already used in the rotation center indicator and resolves the issue where image transparency only worked when the rotation center, grid, or other opaque objects were visible.
Demo:
Before:
before_24003.mp4
After:
after_24003.mp4
Resolves: #24003
Resolves: #15192
Resolves: #24309