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

**URL:** <https://discourse.threejs.org/t/three-webglprogram-no-compiled-fragment-shader-when-at-least-one-graphics-shader-is-attached/15006>\
**Category:** Questions\
**Tags:** shaders\
**Created:** [May 7, 2020, 7:29pm UTC](https://discourse.threejs.org/t/three-webglprogram-no-compiled-fragment-shader-when-at-least-one-graphics-shader-is-attached/15006 "2020-05-07T19:29:10Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![reactor](https://avatars.discourse-cdn.com/v4/letter/r/e47774/32.png) [@reactor](https://discourse.threejs.org/u/reactor)\
**Post date:** [May 7, 2020, 7:29pm UTC](https://discourse.threejs.org/t/three-webglprogram-no-compiled-fragment-shader-when-at-least-one-graphics-shader-is-attached/15006/1 "2020-05-07T19:29:10Z")

</div>

I have this [pastebin](https://pastebin.com/yQjBDghe), 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?

---

<div class="post-metadata">

**Author:** ![reactor](https://avatars.discourse-cdn.com/v4/letter/r/e47774/32.png) [@reactor](https://discourse.threejs.org/u/reactor)\
**Post date:** [May 7, 2020, 9:36pm UTC](https://discourse.threejs.org/t/three-webglprogram-no-compiled-fragment-shader-when-at-least-one-graphics-shader-is-attached/15006/2 "2020-05-07T21:36:20Z")

</div>

Update: posted a [screen](https://imgur.com/YEwxggB) of the error here

---

<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 8, 2020, 9:07am UTC](https://discourse.threejs.org/t/three-webglprogram-no-compiled-fragment-shader-when-at-least-one-graphics-shader-is-attached/15006/3 "2020-05-08T09:07:16Z")

</div>

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

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

---

<div class="post-metadata">

**Author:** ![reactor](https://avatars.discourse-cdn.com/v4/letter/r/e47774/32.png) [@reactor](https://discourse.threejs.org/u/reactor)\
**Post date:** [May 8, 2020, 9:56am UTC](https://discourse.threejs.org/t/three-webglprogram-no-compiled-fragment-shader-when-at-least-one-graphics-shader-is-attached/15006/4 "2020-05-08T09:56:57Z")

</div>

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](https://imgur.com/a/O4DFnpN): 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?
