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

Change blending options in attempt to fix overlapping billboard fringes. #5066

Merged
merged 6 commits into from
Mar 16, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Change Log
* `pitchAdjustHeight` to adjust camera pitch during exaggerated flights, to keep Earth in viewport.
* Added the event `Viewer.trackedEntityChanged`, which is raised when the value of `viewer.trackedEntity` changes. [#5060](https://github.com/AnalyticalGraphicsInc/cesium/pull/5060)
* Added `Camera.DEFAULT_OFFSET` for default view of objects with bounding spheres [#4936](https://github.com/AnalyticalGraphicsInc/cesium/pull/4936)
* Changed billboard blending behavior [#5066](https://github.com/AnalyticalGraphicsInc/cesium/pull/5056)
* Fix crunch compressed textures in IE11. [#5057](https://github.com/AnalyticalGraphicsInc/cesium/pull/5057)
* Fixed a bug in `Quaternion.fromHeadingPitchRoll` that made it erroneously throw an exception when passed individual angles in an unminified / debug build.
* Fix `GroundPrimitive` rendering in 2D and Columbus View [#5078](https://github.com/AnalyticalGraphicsInc/cesium/pull/5078)
Expand Down
12 changes: 9 additions & 3 deletions Source/Scene/BillboardCollection.js
Original file line number Diff line number Diff line change
Expand Up @@ -1453,21 +1453,27 @@ define([
this._rsOpaque = RenderState.fromCache({
depthTest : {
enabled : true,
func : WebGLConstants.LEQUAL // Allows label glyphs and billboards to overlap.
func : WebGLConstants.LESS
},
depthMask : true
});
} else {
this._rsOpaque = undefined;
}

// If OPAQUE_AND_TRANSLUCENT is in use, only the opaque pass gets the benefit of the depth buffer,
// not the translucent pass. Otherwise, if the TRANSLUCENT pass is on its own, it turns on
// a depthMask in lieu of full depth sorting (because it has opaque-ish fragments that look bad in OIT).
// When the TRANSLUCENT depth mask is in use, label backgrounds require the depth func to be LEQUAL.
var useTranslucentDepthMask = this._blendOption === BlendOption.TRANSLUCENT;

if (this._blendOption === BlendOption.TRANSLUCENT || this._blendOption === BlendOption.OPAQUE_AND_TRANSLUCENT) {
this._rsTranslucent = RenderState.fromCache({
depthTest : {
enabled : true,
func : WebGLConstants.LEQUAL // Allows label glyphs and billboards to overlap.
func : (useTranslucentDepthMask ? WebGLConstants.LEQUAL : WebGLConstants.LESS)
},
depthMask : this._blendOption === BlendOption.TRANSLUCENT,
depthMask : useTranslucentDepthMask,
blending : BlendingState.ALPHA_BLEND
});
} else {
Expand Down