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

Revert 1fda8c0 #6779

Merged
merged 5 commits into from
Jul 8, 2018
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 @@ -8,6 +8,7 @@ Change Log

#### Fixes :wrench:
* Fixed bug causing billboards and labels to appear the wrong size when switching scene modes [#6745](https://github.com/AnalyticalGraphicsInc/cesium/issues/6745)
* Fixed a bug that was preventing 3D Tilesets on the opposite side of the globe from being occluded [#6714](https://github.com/AnalyticalGraphicsInc/cesium/issues/6714)

### 1.47 - 2018-07-02

Expand Down
1 change: 1 addition & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,3 +184,4 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to contribute to Cesiu
* [Jonathan Puckey](https://github.com/puckey)
* [Mark Erikson](https://github.com/markerikson)
* [Hannah Bollar](https://github.com/hanbollar)
* [Brandon Barker](https://github.com/ProjectBarks)
10 changes: 9 additions & 1 deletion Source/Scene/DepthPlane.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,23 @@ define([
}

var depthQuadScratch = FeatureDetection.supportsTypedArrays() ? new Float32Array(12) : [];
var scratchRadii = new Cartesian3();
var scratchCartesian1 = new Cartesian3();
var scratchCartesian2 = new Cartesian3();
var scratchCartesian3 = new Cartesian3();
var scratchCartesian4 = new Cartesian3();

function computeDepthQuad(ellipsoid, frameState) {
var radii = ellipsoid.radii;
var radii = Cartesian3.clone(ellipsoid.radii, scratchRadii);
var p = frameState.camera.positionWC;

// Where did this magical number come from? It's how far a GroundPrimitive will be extruded below the surface
// of the Earth. This effectively pushes the depth plane farther from the camera so that classifications on
// 3D Tiles do not intersect the depth plane. This can be removed when depth testing is enabled by default.
radii.x -= 11000.0;
radii.y -= 11000.0;
radii.z -= 11000.0;

// Find the corresponding position in the scaled space of the ellipsoid.
var q = Cartesian3.multiplyComponents(ellipsoid.oneOverRadii, p, scratchCartesian1);

Expand Down
7 changes: 3 additions & 4 deletions Source/Scene/Scene.js
Original file line number Diff line number Diff line change
Expand Up @@ -2314,6 +2314,9 @@ define([

if (clearGlobeDepth) {
clearDepth.execute(context, passState);
if (useDepthPlane) {
depthPlane.execute(context, passState);
}
}

if (!environmentState.useInvertClassification || picking) {
Expand Down Expand Up @@ -2431,10 +2434,6 @@ define([
scene._stencilClearCommand.execute(context, passState);
}

if (clearGlobeDepth && useDepthPlane) {
depthPlane.execute(context, passState);
}

us.updatePass(Pass.OPAQUE);
commands = frustumCommands.commands[Pass.OPAQUE];
length = frustumCommands.indices[Pass.OPAQUE];
Expand Down