Skip to content

Commit

Permalink
Merge pull request #11207 from CesiumGS/depthtestagainstterrain-default
Browse files Browse the repository at this point in the history
Set depthTestAgainstTerrain when using the viewer with baseLayerPicker enabled
  • Loading branch information
jjhembd authored Apr 3, 2023
2 parents df6921e + 1e59b4c commit f29ab6f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/engine/Source/Scene/DepthPlane.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ DepthPlane.prototype.update = function (frameState) {

const context = frameState.context;

// Allow offsetting the ellipsoid radius to address rendering artefacts below ellipsoid zero elevation.
// Allow offsetting the ellipsoid radius to address rendering artifacts below ellipsoid zero elevation.
const radii = frameState.mapProjection.ellipsoid.radii;
const ellipsoid = new Ellipsoid(
radii.x + this._ellipsoidOffset,
Expand Down
2 changes: 2 additions & 0 deletions packages/widgets/Source/Viewer/Viewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -720,6 +720,8 @@ Either specify options.terrainProvider instead or set options.baseLayerPicker to

if (createBaseLayerPicker) {
baseLayerPicker.viewModel.selectedTerrain = undefined;
// Required as this is otherwise set by the baseLayerPicker
scene.globe.depthTestAgainstTerrain = true;
}

scene.setTerrain(options.terrain);
Expand Down

0 comments on commit f29ab6f

Please sign in to comment.