Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Fixed XR Layer rendering race condition with session initialization a…
…nd RenderState update.
  • Loading branch information
zjm-meta committed Mar 7, 2024
commit 4e0bff7952a62d358ce9d82212aa379aad1c6ae7
3 changes: 1 addition & 2 deletions src/components/layer.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ module.exports.Component = registerComponent('layer', {
},

tick: function () {
if (!this.el.sceneEl.xrSession) { return; }
if (!this.el.sceneEl.xrSession || !this.el.sceneEl.renderer.xr.isPresenting) { return; }
if (!this.layer && this.el.sceneEl.is('vr-mode')) { this.initLayer(); }
this.updateTransform();
if (this.data.src.complete && (this.pendingCubeMapUpdate || this.loadingScreen || this.visibilityChanged)) { this.loadCubeMapImages(); }
Expand Down Expand Up @@ -367,7 +367,6 @@ module.exports.Component = registerComponent('layer', {
return;
}
xrSession.requestReferenceSpace('local-floor').then(this.onRequestedReferenceSpace);
this.needsRedraw = true;
this.layerEnabled = true;
if (this.quadPanelEl) {
this.quadPanelEl.object3D.visible = false;
Expand Down