Skip to content

Commit 6048170

Browse files
authored
Merge pull request CesiumGS#8646 from CesiumGS/lequal
Use LEQUAL instead of LESS for depth testing models.
2 parents 7db51c7 + b32e4f3 commit 6048170

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

CHANGES.md

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Change Log
55

66
##### Breaking Changes :mega:
77
* `Cesium3DTileset.skipLevelOfDetail` is now `false` by default. [#8631](https://github.com/CesiumGS/cesium/pull/8631)
8+
* 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.
89

910
##### Additions :tada:
1011

Source/Scene/Model.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ import Axis from './Axis.js';
5757
import BlendingState from './BlendingState.js';
5858
import ClippingPlaneCollection from './ClippingPlaneCollection.js';
5959
import ColorBlendMode from './ColorBlendMode.js';
60+
import DepthFunction from './DepthFunction.js';
6061
import DracoLoader from './DracoLoader.js';
6162
import getClipAndStyleCode from './getClipAndStyleCode.js';
6263
import getClippingFunction from './getClippingFunction.js';
@@ -3010,7 +3011,8 @@ import ShadowMode from './ShadowMode.js';
30103011
enabled : enableCulling
30113012
},
30123013
depthTest : {
3013-
enabled : true
3014+
enabled : true,
3015+
func: DepthFunction.LESS_OR_EQUAL
30143016
},
30153017
depthMask : !blendingEnabled,
30163018
blending : {

Specs/Scene/ModelSpec.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ import { DracoLoader } from '../../Source/Cesium.js';
3232
import { HeightReference } from '../../Source/Cesium.js';
3333
import { Model } from '../../Source/Cesium.js';
3434
import { ModelAnimationLoop } from '../../Source/Cesium.js';
35+
import { DepthFunction } from '../../Source/Cesium.js';
3536
import createScene from '../createScene.js';
3637
import pollToPromise from '../pollToPromise.js';
3738
import { when } from '../../Source/Cesium.js';
@@ -522,7 +523,8 @@ describe('Scene/Model', function() {
522523
enabled : true
523524
},
524525
depthTest : {
525-
enabled : true
526+
enabled : true,
527+
func : DepthFunction.LESS_OR_EQUAL
526528
},
527529
depthMask : true,
528530
blending : {

0 commit comments

Comments
 (0)