diff --git a/src/components/scene/reflection.js b/src/components/scene/reflection.js index 8485c629199..f4de52349bc 100644 --- a/src/components/scene/reflection.js +++ b/src/components/scene/reflection.js @@ -45,7 +45,7 @@ module.exports.Component = register('reflection', { var renderer = self.el.renderer; var session = renderer.xr.getSession(); if ( - session.requestLightProbe && self.el.is('ar-mode') + session && session.requestLightProbe && self.el.is('ar-mode') ) { self.startLightProbe(); } @@ -61,9 +61,9 @@ module.exports.Component = register('reflection', { this.xrLightProbe = null; if (this.probeLight) { this.probeLight.components.light.light.intensity = 0; + this.needsVREnvironmentUpdate = true; + this.el.object3D.environment = this.cubeRenderTarget.texture; } - this.needsVREnvironmentUpdate = true; - this.el.object3D.environment = this.cubeRenderTarget.texture; }, startLightProbe: function () { this.needsLightProbeUpdate = true;