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

new equation in czm_alphaWeight shader function #6340

Merged
merged 6 commits into from
Mar 21, 2018

Conversation

arneschilling
Copy link
Contributor

The current alpha blending function used in Cesium in not suitable for our vegetation models.
In particular, we have problems displaying a large number of trees from I3DM if they are modelled as transparent billboards. Blended colors from overlapping textures are way too bright.

Changing the equation in function czm_alphaWeight fixed this problem.
The referenced paper in Shaders/Builtin/Functions/alphaWeight.js (http://jcgt.org/published/0002/02/09) mentions several alpha weight functions that can be used. Buildings and other geometries don't seem to be affected.
Equation (9) works best for us:
pow(a + 0.01, 4.0) + max(1e-2, min(3.0 * 1e3, 0.003 / (1e-5 + pow(abs(z) / 200.0, 4.0))))

comparison of alpha blending with current equation (8) - left and (9) - right:

treescomp
bahnhofcomp
oitdemocomp

@cesium-concierge
Copy link

Please sign the CLA before we review this PR.

Welcome to the Cesium community @arneschilling!

Can you please send in a Contributor License Agreement (CLA) so that we can review and merge this pull request?

⚠️ I noticed that CHANGES.md has not been updated. If this change updates the public API in any way, fixes a bug, or makes any non-trivial update, please add a bullet point to CHANGES.md and comment on this pull request so we know it was updated. For more info, see the Pull Request Guidelines.


I am a bot who helps you make Cesium awesome! Contributions to my configuration are welcome.

🌍 🌎 🌏

@pjcozzi
Copy link
Contributor

pjcozzi commented Mar 16, 2018

Thanks @arneschilling!

There is a corporate CLA covering this. @arneschilling please add yourself to the virtualcitySYSTEMS GmbH section of CONTRIBUTORS.md.

@mramato
Copy link
Contributor

mramato commented Mar 20, 2018

Spoke with @bagnell offline, he's fine with this change (we both agree this is a big improvement, I've always need annoyed by it personally).

@arneschilling, please add an entry in CHANGES.md about this improvement and add yourself to CONTRIBUTORS.md (as @pjcozzi said above) and then we'll merge this.

Thanks!

arneschilling and others added 5 commits March 21, 2018 14:39
changes in CHANGES.md
evert "added myself in CONTRIBUTORS.md"

This reverts commit c328362.
changes in CHANGES.md
@arneschilling
Copy link
Contributor Author

okay, check

@mramato
Copy link
Contributor

mramato commented Mar 21, 2018

Thanks @arneschilling!

@mramato mramato merged commit 3138309 into CesiumGS:master Mar 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants