THREE.WebGLProgram: No compiled fragment shader when at least one graphics shader is attached

I have this pastebin, where i try to select a face, and change its texture into another one, but when i click on the cube, the error in the title came up. What am i missing?

Update: posted a screen of the error here

I’ve adapted most of your code in this fiddle: https://jsfiddle.net/kvszg80d/

I’m unable to reproduce the issue. Please update the live example so it demonstrates the error.

I found out that the error in my code was in the following instruction:

var materialTemp = new THREE.MeshBasicMaterial({ map: materials[0] });

changing it into:

var materialTemp = materials[0];

Basically what I am doing is to create a geometry with the same properties of the face intersected by Raycaster, apply to it a new texture and overlapping onto the selected face. But i encounter the following problem:

  • Screen: the texture is not covering the entire face, but only a triangle (there are 2 triangle per face).
  • When i rotate the cube, new texture tremble slightly, revealing the old texture.

How can i fix these two?