Skip to content

Commit 1fda8c0

Browse files
committed
Update when depth plane is rendered.
1 parent d7426a8 commit 1fda8c0

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
@@ -50,23 +50,15 @@ define([
5050
}
5151

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

5958
function computeDepthQuad(ellipsoid, frameState) {
60-
var radii = Cartesian3.clone(ellipsoid.radii, scratchRadii);
59+
var radii = ellipsoid.radii;
6160
var p = frameState.camera.positionWC;
6261

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

Source/Scene/Scene.js

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

19461946
if (clearGlobeDepth) {
19471947
clearDepth.execute(context, passState);
1948-
if (useDepthPlane) {
1949-
depthPlane.execute(context, passState);
1950-
}
19511948
}
19521949

19531950
us.updatePass(Pass.CESIUM_3D_TILE);
@@ -1968,6 +1965,10 @@ define([
19681965
executeCommand(commands[j], scene, context, passState);
19691966
}
19701967

1968+
if (clearGlobeDepth && useDepthPlane) {
1969+
depthPlane.execute(context, passState);
1970+
}
1971+
19711972
// Execute commands in order by pass up to the translucent pass.
19721973
// Translucent geometry needs special handling (sorting/OIT).
19731974
var startPass = Pass.CESIUM_3D_TILE_CLASSIFICATION + 1;

0 commit comments

Comments
 (0)