1
votes

after following 3 different guides for cube mapping in three.js, I've always encounered same errors in the console:

  • " ebGL: INVALID_FRAMEBUFFER_OPERATION: drawElements: attachment has a 0 dimension"
  • "ebGL: INVALID_FRAMEBUFFER_OPERATION: drawArrays: attachment has a 0 dimension"
  • "[.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'"

Those three errors are repated several time in the console.

Here is a guide and a live example i've tried to emulate:

Guide 1

Live Example

Right now my code is similar to the one in the live example:

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);

and this is the render function:

function render()

{

provaCil.visible = false;
cubeCameraBottom1.updateCubeMap( renderer, scene );
provaCil.visible = true;
renderer.render( scene, camera );

}

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

1

1 Answers

0
votes

In the example they used r60. Just maybe that's the Problem, and maybe this can help you:

https://www.khronos.org/registry/webgl/extensions/WEBGL_lose_context/