Skip to content

Commit de4299d

Browse files
committed
Revert #6779
1 parent 4bbf35e commit de4299d

File tree

2 files changed

+5
-12
lines changed

2 files changed

+5
-12
lines changed

Source/Scene/DepthPlane.js

+1-9
Original file line numberDiff line numberDiff line change
@@ -51,23 +51,15 @@ define([
5151
}
5252

5353
var depthQuadScratch = FeatureDetection.supportsTypedArrays() ? new Float32Array(12) : [];
54-
var scratchRadii = new Cartesian3();
5554
var scratchCartesian1 = new Cartesian3();
5655
var scratchCartesian2 = new Cartesian3();
5756
var scratchCartesian3 = new Cartesian3();
5857
var scratchCartesian4 = new Cartesian3();
5958

6059
function computeDepthQuad(ellipsoid, frameState) {
61-
var radii = Cartesian3.clone(ellipsoid.radii, scratchRadii);
60+
var radii = ellipsoid.radii;
6261
var p = frameState.camera.positionWC;
6362

64-
// Where did this magical number come from? It's how far a GroundPrimitive will be extruded below the surface
65-
// of the Earth. This effectively pushes the depth plane farther from the camera so that classifications on
66-
// 3D Tiles do not intersect the depth plane. This can be removed when depth testing is enabled by default.
67-
radii.x -= 11000.0;
68-
radii.y -= 11000.0;
69-
radii.z -= 11000.0;
70-
7163
// Find the corresponding position in the scaled space of the ellipsoid.
7264
var q = Cartesian3.multiplyComponents(ellipsoid.oneOverRadii, p, scratchCartesian1);
7365

Source/Scene/Scene.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -2315,9 +2315,6 @@ define([
23152315

23162316
if (clearGlobeDepth) {
23172317
clearDepth.execute(context, passState);
2318-
if (useDepthPlane) {
2319-
depthPlane.execute(context, passState);
2320-
}
23212318
}
23222319

23232320
if (!environmentState.useInvertClassification || picking) {
@@ -2435,6 +2432,10 @@ define([
24352432
scene._stencilClearCommand.execute(context, passState);
24362433
}
24372434

2435+
if (clearGlobeDepth && useDepthPlane) {
2436+
depthPlane.execute(context, passState);
2437+
}
2438+
24382439
us.updatePass(Pass.OPAQUE);
24392440
commands = frustumCommands.commands[Pass.OPAQUE];
24402441
length = frustumCommands.indices[Pass.OPAQUE];

0 commit comments

Comments
 (0)