mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-21 10:42:22 +00:00
fix(render): translucent icons stack in order, as Cesium's translucent billboards
Cesium draws BlendOption.TRANSLUCENT billboards in the opaque pass, blended, LESS_OR_EQUAL with depth written, so overlapping ones stack in their order, the last on top; in the translucent pass the scene's order-independent blend averages them. A translucent GPU icon set now draws its one pass there too, with the depth function Cesium names LESS_OR_EQUAL (LEQUAL is not one of its names, and fell back to LESS: the first row won). A set's blend no longer moves the commands of a collection built translucent into the translucent pass.
This commit is contained in:
1 parent
01788c1b10
commit
44c9ed6d5c
3 files changed
+33
-10
No files matched your search
@@ -327,10 +327,9 @@ const EARTH_BOUNDS = new Cesium.BoundingSphere(
|
||||
* a newly loaded image, for a layer that does not render continuously.
|
||||
* `cull` says whether rows past the ellipsoid's horizon are hidden (by
|
||||
* default always). `translucent` says whether every row is drawn in one
|
||||
* alpha-blended pass, as Cesium's `BlendOption.TRANSLUCENT` billboards
|
||||
* are, in place of an opaque pass and a translucent one (by default
|
||||
* never); under order-independent translucency, overlapping rows blend
|
||||
* together, as those billboards do. `pickObject` builds a row's pick object around the
|
||||
* alpha-blended pass in the opaque pass, in row order, the last on top, as
|
||||
* Cesium's `BlendOption.TRANSLUCENT` billboards are, in place of an opaque
|
||||
* pass and a translucent one (by default never). `pickObject` builds a row's pick object around the
|
||||
* `primitive` drill picks hide it by (by default `{ id, iconSet, meta,
|
||||
* primitive }`).
|
||||
*/
|
||||
@@ -796,13 +795,15 @@ export class IconSetPrimitive {
|
||||
}),
|
||||
),
|
||||
];
|
||||
// Every row in one blended pass, equal depths passing and depth written
|
||||
// in place of sorting, as Cesium's translucent billboards are drawn.
|
||||
// Every row in one blended pass, in row order, equal depths passing and
|
||||
// depth written in place of sorting: in the opaque pass, as Cesium's
|
||||
// translucent billboards are drawn, out of the translucent pass's
|
||||
// order-independent blend.
|
||||
this._singleCommand = command(
|
||||
Cesium.Pass.TRANSLUCENT,
|
||||
Cesium.Pass.OPAQUE,
|
||||
this._programs.single,
|
||||
Cesium.RenderState.fromCache({
|
||||
depthTest: { enabled: true, func: Cesium.DepthFunction.LEQUAL },
|
||||
depthTest: { enabled: true, func: Cesium.DepthFunction.LESS_OR_EQUAL },
|
||||
depthMask: true,
|
||||
blending: Cesium.BlendingState.ALPHA_BLEND,
|
||||
}),
|
||||
|
||||
Reference in new issue
Block a user