# Faded Reflection

**URL:** <https://discourse.threejs.org/t/faded-reflection/39730>\
**Category:** Questions\
**Tags:** react-three-fiber\
**Created:** [June 28, 2022, 3:58am UTC](https://discourse.threejs.org/t/faded-reflection/39730 "2022-06-28T03:58:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![yanling](https://avatars.discourse-cdn.com/v4/letter/y/67e7ee/32.png) [@yanling](https://discourse.threejs.org/u/yanling)\
**Post date:** [June 28, 2022, 3:58am UTC](https://discourse.threejs.org/t/faded-reflection/39730/1 "2022-06-28T03:58:52Z")

</div>

Hi, drcmda  
I was trying to use mesh reflector material ([GitHub - pmndrs/drei: 🥉 useful helpers for react-three-fiber](https://github.com/pmndrs/drei#meshreflectormaterial)) in webvr, but it makes the entire vr scene into black. Do you have any ideas to make it work properly?

```javascript
    useFrame(() => {
      // TODO: As of R3f 7-8 this should be __r3f.parent
      const parent =
        (materialRef.current as any).parent || (materialRef.current as any)?.__r3f.parent;
      if (!parent) return;
      parent.visible = false;
      const currentXrEnabled = gl.xr.enabled;
      const currentShadowAutoUpdate = gl.shadowMap.autoUpdate;
      beforeRender();
      gl.xr.enabled = false;
      gl.shadowMap.autoUpdate = false;
      gl.setRenderTarget(fbo1); 
      gl.state.buffers.depth.setMask(true); // <----- This Line?
      if (!gl.autoClear) gl.clear();
      gl.render(scene, virtualCamera);
      if (hasBlur) blurpass.render(gl, fbo1, fbo2);
      gl.xr.enabled = currentXrEnabled;
      gl.shadowMap.autoUpdate = currentShadowAutoUpdate;
      parent.visible = true;
      gl.setRenderTarget(null);
    });

```
