# Is the CubeCamera not working?

**URL:** https://discourse.threejs.org/t/is-the-cubecamera-not-working/7793
**Category:** Questions
**Tags:** camera
**Created:** [May 29, 2019, 8:43am UTC](https://discourse.threejs.org/t/is-the-cubecamera-not-working/7793 "2019-05-29T08:43:58Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![RandomPerson](https://avatars.discourse-cdn.com/v4/letter/r/b5a626/32.png) [@RandomPerson](https://discourse.threejs.org/u/RandomPerson)
#### Post date: [May 29, 2019, 8:43am UTC](https://discourse.threejs.org/t/is-the-cubecamera-not-working/7793/1 "2019-05-29T08:43:58Z")

</div>

Hi everyone,  
i was trying to create a cube-camera for my scene and for some reason only one side of the cube is rendered.  
So i went back to look at the examples and in the Demo  
[https://threejs.org/examples/#webgl\_shading\_physical](https://threejs.org/examples/#webgl_shading_physical)  
is the same problem: The ball that should reflect something is just black with only one face of the cube-camera rendered on it.

---

<div class="post-metadata">

### Author: ![Mugen87](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/mugen87/32/5645_2.png) [@Mugen87](https://discourse.threejs.org/u/Mugen87)
#### Post date: [May 29, 2019, 11:00am UTC](https://discourse.threejs.org/t/is-the-cubecamera-not-working/7793/2 "2019-05-29T11:00:30Z")

</div>

This is definitely a bug, introduced with this [change](https://github.com/mrdoob/three.js/pull/15571). The `three.js` example does work with `R101`. Another workaround is to deactivate shadows.

Here is the line of code causing the issue:

> <https://github.com/mrdoob/three.js/blob/80f77286a1b5a1aabdc9a4e61425a0015fd9f468/src/renderers/webgl/WebGLShadowMap.js#L261>

`WebGLShadowMap` wants to restore the current render target but it does not apply the correct active cube face and mipmap level.

---

<div class="post-metadata">

### Author: ![Mugen87](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/mugen87/32/5645_2.png) [@Mugen87](https://discourse.threejs.org/u/Mugen87)
#### Post date: [May 29, 2019, 11:25am UTC](https://discourse.threejs.org/t/is-the-cubecamera-not-working/7793/3 "2019-05-29T11:25:52Z")

</div>

Let’s see if this PR gets merged:

> <https://github.com/mrdoob/three.js/pull/16603>

---

<div class="post-metadata">

### Author: ![RandomPerson](https://avatars.discourse-cdn.com/v4/letter/r/b5a626/32.png) [@RandomPerson](https://discourse.threejs.org/u/RandomPerson)
#### Post date: [May 29, 2019, 11:37am UTC](https://discourse.threejs.org/t/is-the-cubecamera-not-working/7793/4 "2019-05-29T11:37:16Z")

</div>

Ahhh, cool. Thanks for looking into it and the response.  
If the images get rendered thats okay for what i am trying to do atm:  
I need to save these images to disk so i can generate a lightprobe from them.

Maybe in the future this step can beeven optional so it works like this:  
lightProbe.copy( THREE.LightProbeGenerator.fromCubeTexture( cubeCam.renderTarget.texture ) );

Anyway, thanks again!

---

<div class="post-metadata">

### Author: ![Mugen87](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/mugen87/32/5645_2.png) [@Mugen87](https://discourse.threejs.org/u/Mugen87)
#### Post date: [May 29, 2019, 1:25pm UTC](https://discourse.threejs.org/t/is-the-cubecamera-not-working/7793/5 "2019-05-29T13:25:23Z")

</div>

Okay, the PR is merged. Fixed with `R105` 🎉
