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

Semi-transparent polygons #139

Open
c42f opened this issue Sep 29, 2016 · 3 comments
Open

Semi-transparent polygons #139

c42f opened this issue Sep 29, 2016 · 3 comments
Labels

Comments

@c42f
Copy link
Owner

c42f commented Sep 29, 2016

Crude support for semi-transparent polygons would be quite useful CC @Ross-Batten .

In general, there's no nice way to do this in standard OpenGL, since OpenGL doesn't support order independent transparency; without special CPU-side handling, rendering artifacts are guaranteed. As far as I'm aware, the usual solution to this is:

  1. Render all opaque geometry as usual
  2. Ensure transparent primitives cannot intersect using high level logic ("game logic")
  3. Sort transparent primitives by depth
  4. Render primitives in the sorted order, back to front, with alpha compositing enabled.

We could potentially implement the above in a crude way, by just ignoring step 2 which can't be fixed without heroic efforts. The idea would be:

  • Add transparency flag to Geometry instances.
  • Separate transparent Geometry instances into a separate list, sort, and render front to back.
@nigels-com
Copy link
Collaborator

Depth Peeling is a potential approach, depending on the number of layers.
Fairly GPU intensive. https://en.wikipedia.org/wiki/Depth_peeling
http://doc.jzy3d.org/depthpeeling/DualDepthPeeling.pdf

@c42f
Copy link
Owner Author

c42f commented Sep 30, 2016

Thanks, this is interesting - particularly the single pass approximation - displaz is not aiming for realism but utility, so using an approximation would be fine as long as it's not distracting.

@c42f c42f added the 3d label Oct 2, 2016
@bhack
Copy link

bhack commented Jun 6, 2017

Probably something could be done in the QT3D framegraph.

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

No branches or pull requests

3 participants