diff --git a/CHANGES.md b/CHANGES.md index f6cf17687bd9..ad2c70a63ded 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -5,6 +5,7 @@ Change Log ##### Breaking Changes :mega: * `Cesium3DTileset.skipLevelOfDetail` is now `false` by default. [#8631](https://github.com/CesiumGS/cesium/pull/8631) +* glTF models are now rendered using the `LEQUALS` depth test function insead of `LESS`. This means that when geometry overlaps, the _later_ geometry will be visible above the earlier, where previously the opposite was true. We believe this is a more sensible default, and makes it easier to render e.g. outlined buildings with glTF. ##### Additions :tada: diff --git a/Source/Scene/Model.js b/Source/Scene/Model.js index 9ed90e24741c..977a32488770 100644 --- a/Source/Scene/Model.js +++ b/Source/Scene/Model.js @@ -57,6 +57,7 @@ import Axis from './Axis.js'; import BlendingState from './BlendingState.js'; import ClippingPlaneCollection from './ClippingPlaneCollection.js'; import ColorBlendMode from './ColorBlendMode.js'; +import DepthFunction from './DepthFunction.js'; import DracoLoader from './DracoLoader.js'; import getClipAndStyleCode from './getClipAndStyleCode.js'; import getClippingFunction from './getClippingFunction.js'; @@ -3010,7 +3011,8 @@ import ShadowMode from './ShadowMode.js'; enabled : enableCulling }, depthTest : { - enabled : true + enabled : true, + func: DepthFunction.LESS_OR_EQUAL }, depthMask : !blendingEnabled, blending : { diff --git a/Specs/Scene/ModelSpec.js b/Specs/Scene/ModelSpec.js index 574658226ffa..a4e8c92bd67d 100644 --- a/Specs/Scene/ModelSpec.js +++ b/Specs/Scene/ModelSpec.js @@ -32,6 +32,7 @@ import { DracoLoader } from '../../Source/Cesium.js'; import { HeightReference } from '../../Source/Cesium.js'; import { Model } from '../../Source/Cesium.js'; import { ModelAnimationLoop } from '../../Source/Cesium.js'; +import { DepthFunction } from '../../Source/Cesium.js'; import createScene from '../createScene.js'; import pollToPromise from '../pollToPromise.js'; import { when } from '../../Source/Cesium.js'; @@ -522,7 +523,8 @@ describe('Scene/Model', function() { enabled : true }, depthTest : { - enabled : true + enabled : true, + func : DepthFunction.LESS_OR_EQUAL }, depthMask : true, blending : {