Skip to content

Commit

Permalink
Merge pull request #8646 from CesiumGS/lequal
Browse files Browse the repository at this point in the history
Use LEQUAL instead of LESS for depth testing models.
  • Loading branch information
lilleyse authored Mar 2, 2020
2 parents 7db51c7 + b32e4f3 commit 6048170
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
4 changes: 3 additions & 1 deletion Source/Scene/Model.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -3010,7 +3011,8 @@ import ShadowMode from './ShadowMode.js';
enabled : enableCulling
},
depthTest : {
enabled : true
enabled : true,
func: DepthFunction.LESS_OR_EQUAL
},
depthMask : !blendingEnabled,
blending : {
Expand Down
4 changes: 3 additions & 1 deletion Specs/Scene/ModelSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -522,7 +523,8 @@ describe('Scene/Model', function() {
enabled : true
},
depthTest : {
enabled : true
enabled : true,
func : DepthFunction.LESS_OR_EQUAL
},
depthMask : true,
blending : {
Expand Down

0 comments on commit 6048170

Please sign in to comment.