title: WebGL three.js cube camera mapping
body: <p>after following 3 different guides for cube mapping in three.js, I've always encounered same errors in the console:</p>
  
  <ul>
  <li>" ebGL: INVALID_FRAMEBUFFER_OPERATION: drawElements: attachment has a
  0 dimension"</li>
  <li>"ebGL: INVALID_FRAMEBUFFER_OPERATION: drawArrays: attachment has a 0
  dimension"</li>
  <li>"[.WebGLRenderingContext]RENDER WARNING: texture bound to texture
  unit 0 is not renderable. It maybe non-power-of-2 and have
  incompatible texture filtering or is not 'texture complete'"</li>
  </ul>
  
  <p>Those three errors are repated several time in the console.</p>
  
  <p>Here is a guide and a live example i've tried to emulate:</p>
  
  <p><a href="http://learningthreejs.com/blog/2014/05/12/live-cube-maps-reflections-in-your-three-dot-js-game-with-threex-dot-cubecamera/" rel="nofollow">Guide 1</a></p>
  
  <p><a href="http://stemkoski.github.io/Three.js/Reflection.html" rel="nofollow">Live Example</a></p>
  
  <p>Right now my code is similar to the one in the live example:</p>
  
  <pre><code>cubeCameraBottom1 = new THREE.CubeCamera(0.1, 5000, 512 );
  scene.add(cubeCameraBottom1);      
  var provacylGeometry = new THREE.CylinderGeometry(8, 8, 70, 32, 32);
  var provacylinderMaterial = new THREE.MeshPhongMaterial( {  envMap: cubeCameraBottom1.renderTarget } );
  provaCil = new THREE.Mesh( provacylGeometry, provacylinderMaterial );
  provaCil.position.set(0,0,-20);
  provaCil.castShadow = true;
  cubeCameraBottom1.position = provaCil.position;
  scene.add(provaCil);
  </code></pre>
  
  <p>and this is the render function:</p>
  
  <pre><code>function render()
  </code></pre>
  
  <p>{</p>
  
  <pre><code>provaCil.visible = false;
  cubeCameraBottom1.updateCubeMap( renderer, scene );
  provaCil.visible = true;
  renderer.render( scene, camera );
  </code></pre>
  
  <p>}</p>
  
  <p>Where am I going wrong? It looks like the cube camera is not computing textures in the right way.
  How can I fix this?
  Thanks in advance</p>