Skip to content

Commit d3dccb3

Browse files
authored
Merge pull request #129 from De-Panther/workaround_chromium_depth_bug
Workaround for Chromium depth bug
2 parents 3a8bd4a + 177821e commit d3dccb3

File tree

5 files changed

+8
-2
lines changed

5 files changed

+8
-2
lines changed

Build/Build/Build.data.unityweb

471 Bytes
Binary file not shown.

Build/Build/Build.wasm

-485 Bytes
Binary file not shown.

Build/Build/Build.wasm.framework.unityweb

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

Packages/webxr/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
## [Unreleased]
88

9+
### Fixed
10+
- Workaround for Chromium depth bug (Chromium issue 1167450).
11+
912
## [0.8.0] - 2020-02-26
1013
### Added
1114
- ToggleAR, ToggleVR, isSupportedAR and isSupportedVR to WebXRManager.

Packages/webxr/Runtime/Plugins/WebGL/webxr.jspre

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -833,7 +833,10 @@ setTimeout(function () {
833833
this.ctx.bindFramebuffer(this.ctx.FRAMEBUFFER, glLayer.framebuffer);
834834
if (session.isAR) {
835835
this.ctx.dontClearOnFrameStart = true;
836-
this.ctx.clear(this.ctx.STENCIL_BUFFER_BIT | this.ctx.DEPTH_BUFFER_BIT);
836+
// Workaround for Chromium depth bug https://bugs.chromium.org/p/chromium/issues/detail?id=1167450#c21
837+
this.ctx.depthMask(false);
838+
this.ctx.clear(this.ctx.DEPTH_BUFFER_BIT);
839+
this.ctx.depthMask(true);
837840
} else {
838841
this.ctx.clear(this.ctx.COLOR_BUFFER_BIT | this.ctx.DEPTH_BUFFER_BIT);
839842
}

0 commit comments

Comments
 (0)