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

Feature request: Depth peeling for correct transparency visualization #1390

Open
sina-mansour opened this issue Nov 5, 2022 · 2 comments
Open

Comments

@sina-mansour
Copy link

Description

The current methods available for the creation of large transparent objects have certain limitations which result in imperfect visualization of surface meshes with transparent vertices. I have detailed this issue in this blog post. A suggested solution that can resolve this problem would be depth peeling. It has previously been implemented in tools such as Mayavi, and in my experience, the results after depth peeling are satisfactory.

It would be great if depth peeling could be added as a new feature, potentially as a new TransparencyAttrib that the user could enable.

Use Case

The main use case of this feature would be in rendering objects with transparency. Order-independent transparency remains to be a subject of interest in computer graphics for rendering transparency accurately and depth peeling is a relatively straightforward method that achieves a great level of quality in rendering transparency.

I think that this change is highly important as there are many cases where transparent objects need to be rendered and currently implemented panda3d methods fail at providing proper transparency visualizations.

@rdb
Copy link
Member

rdb commented Nov 5, 2022

I also experimented with Order-Independent Transparency using Per-Pixel Linked Lists here:
https://discourse.panda3d.org/t/order-independent-transparency-using-per-pixel-linked-lists/28875

But, it has enough drawbacks that it's worth considering depth peeling instead (or in addition). Tempting is to put all transparent objects into a CullBin of their own, and render that N times, swapping out the depth buffers in between and applying a shader that takes this depth buffer into account. But there is no good way to swap out depth buffers during rendering at the moment, so an easier way might be to implement it in CommonFilters, with separate buffers for each peel.

A related technique also worth considering is dual depth peeling:
http://doc.jzy3d.org/depthpeeling/DualDepthPeeling.pdf

@git2323
Copy link
Contributor

git2323 commented Aug 15, 2023

Would be much appreciated if also C++ users of Panda3D could use these new implementations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants