Skip to content

Commit 63c3360

Browse files
committed
Fixed Depth and Stencil clear issue in Handheld AR
1 parent 7447d30 commit 63c3360

File tree

6 files changed

+6
-0
lines changed

6 files changed

+6
-0
lines changed

Build/webxr.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -791,6 +791,7 @@
791791
this.ctx.bindFramebuffer(this.ctx.FRAMEBUFFER, glLayer.framebuffer);
792792
if (session.isAR) {
793793
this.ctx.dontClearOnFrameStart = true;
794+
this.ctx.clear(this.ctx.STENCIL_BUFFER_BIT | this.ctx.DEPTH_BUFFER_BIT);
794795
} else {
795796
this.ctx.clear(this.ctx.COLOR_BUFFER_BIT | this.ctx.DEPTH_BUFFER_BIT);
796797
}

Packages/webxr/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010

1111
### Fixed
1212
- OnDisable in WebXRController.
13+
- Depth and Stencil clear issue in Handheld AR.
1314

1415
## [0.5.1] - 2020-12-26
1516
### Fixed

Packages/webxr/Hidden~/WebGLTemplates/WebXR/webxr.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -791,6 +791,7 @@
791791
this.ctx.bindFramebuffer(this.ctx.FRAMEBUFFER, glLayer.framebuffer);
792792
if (session.isAR) {
793793
this.ctx.dontClearOnFrameStart = true;
794+
this.ctx.clear(this.ctx.STENCIL_BUFFER_BIT | this.ctx.DEPTH_BUFFER_BIT);
794795
} else {
795796
this.ctx.clear(this.ctx.COLOR_BUFFER_BIT | this.ctx.DEPTH_BUFFER_BIT);
796797
}

Packages/webxr/Hidden~/WebGLTemplates/WebXR2020/webxr.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -791,6 +791,7 @@
791791
this.ctx.bindFramebuffer(this.ctx.FRAMEBUFFER, glLayer.framebuffer);
792792
if (session.isAR) {
793793
this.ctx.dontClearOnFrameStart = true;
794+
this.ctx.clear(this.ctx.STENCIL_BUFFER_BIT | this.ctx.DEPTH_BUFFER_BIT);
794795
} else {
795796
this.ctx.clear(this.ctx.COLOR_BUFFER_BIT | this.ctx.DEPTH_BUFFER_BIT);
796797
}

Packages/webxr/Hidden~/WebGLTemplates/WebXRFullView/webxr.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -791,6 +791,7 @@
791791
this.ctx.bindFramebuffer(this.ctx.FRAMEBUFFER, glLayer.framebuffer);
792792
if (session.isAR) {
793793
this.ctx.dontClearOnFrameStart = true;
794+
this.ctx.clear(this.ctx.STENCIL_BUFFER_BIT | this.ctx.DEPTH_BUFFER_BIT);
794795
} else {
795796
this.ctx.clear(this.ctx.COLOR_BUFFER_BIT | this.ctx.DEPTH_BUFFER_BIT);
796797
}

Packages/webxr/Hidden~/WebGLTemplates/WebXRFullView2020/webxr.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -791,6 +791,7 @@
791791
this.ctx.bindFramebuffer(this.ctx.FRAMEBUFFER, glLayer.framebuffer);
792792
if (session.isAR) {
793793
this.ctx.dontClearOnFrameStart = true;
794+
this.ctx.clear(this.ctx.STENCIL_BUFFER_BIT | this.ctx.DEPTH_BUFFER_BIT);
794795
} else {
795796
this.ctx.clear(this.ctx.COLOR_BUFFER_BIT | this.ctx.DEPTH_BUFFER_BIT);
796797
}

0 commit comments

Comments
 (0)