Hi everyone,

The code below for vertex and fragment shaders was working fine in r106, i am using instancing with map, normalmap, lightmap and lights, i use a single directional light in the scene, now i am updating threejs to r111 and i get webgl error;

Here is the code below;

```
var vertex = [
"#define PHONG",
"precision highp float;",
"attribute vec3 instancePosition;",
"attribute vec4 instanceQuaternion;",
"attribute vec3 instanceScale;",
"varying vec3 vViewPosition;",
"#ifndef FLAT_SHADED",
"varying vec3 vNormal;",
"#endif",
"vec3 applyTRS( vec3 position, vec3 translation, vec4 quaternion, vec3 scale ) {",
"position *= scale;",
"position += 2.0 * cross( quaternion.xyz, cross( quaternion.xyz, position ) + quaternion.w * position );",
"return position + translation;",
"}",
THREE.ShaderChunk["common"],
THREE.ShaderChunk["uv_pars_vertex"],
THREE.ShaderChunk["uv2_pars_vertex"],
THREE.ShaderChunk["color_pars_vertex"],
THREE.ShaderChunk["fog_pars_vertex"],
"void main() {",
THREE.ShaderChunk["uv_vertex"],
THREE.ShaderChunk["uv2_vertex"],
THREE.ShaderChunk["color_vertex"],
THREE.ShaderChunk["beginnormal_vertex"],
THREE.ShaderChunk["morphnormal_vertex"],
THREE.ShaderChunk["defaultnormal_vertex"],
"#ifndef FLAT_SHADED", // Normal computed with derivatives when FLAT_SHADED
"vNormal = normalize( transformedNormal );",
"#endif",
THREE.ShaderChunk["begin_vertex"],
"vec4 mvPosition = modelViewMatrix * vec4( applyTRS( position.xyz, instancePosition, instanceQuaternion, instanceScale ), 1.0 );",
"gl_Position = projectionMatrix * mvPosition;",
"vViewPosition = - mvPosition.xyz;",
THREE.ShaderChunk["worldpos_vertex"],
THREE.ShaderChunk["fog_vertex"],
"}"
].join("\n");
var fragment = [
"#define PHONG",
"uniform vec3 diffuse;",
"uniform vec3 emissive;",
"uniform vec3 specular;",
"uniform float shininess;",
"uniform float opacity;",
THREE.ShaderChunk["common"],
THREE.ShaderChunk["packing"],
THREE.ShaderChunk["uv_pars_fragment"],
THREE.ShaderChunk["uv2_pars_fragment"],
THREE.ShaderChunk["map_pars_fragment"],
THREE.ShaderChunk["lightmap_pars_fragment"],
THREE.ShaderChunk["fog_pars_fragment"],
THREE.ShaderChunk["bsdfs"],
THREE.ShaderChunk["lights_pars_begin"],
THREE.ShaderChunk["lights_phong_pars_fragment"],
THREE.ShaderChunk["normalmap_pars_fragment"],
THREE.ShaderChunk["specularmap_pars_fragment"],
"void main() {",
"vec4 diffuseColor = vec4( diffuse, opacity );",
"ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );",
"vec3 totalEmissiveRadiance = emissive;",
THREE.ShaderChunk["map_fragment"],
THREE.ShaderChunk["specularmap_fragment"],
THREE.ShaderChunk["normal_fragment_begin"],
THREE.ShaderChunk["normal_fragment_maps"],
THREE.ShaderChunk["lights_phong_fragment"],
THREE.ShaderChunk["lights_fragment_begin"],
THREE.ShaderChunk["lights_fragment_maps"],
THREE.ShaderChunk["lights_fragment_end"],
"vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;",
"gl_FragColor = vec4( outgoingLight, diffuseColor.a );",
THREE.ShaderChunk["encodings_fragment"],
THREE.ShaderChunk["fog_fragment"],
"}"
].join("\n");
```

And i get the error below;

lib_20122019.js:18246 THREE.WebGLProgram: shader error: 0 35715 false gl.getProgramInfoLog No compiled fragment shader when at least one graphics shader is attached.

THREE.WebGLShader: gl.getShaderInfoLog() fragment

ERROR: 0:601: âvUvâ : undeclared identifier

ERROR: 0:601: âtexture2Dâ : no matching overloaded function found

ERROR: 0:601: â=â : dimension mismatch

ERROR: 0:601: â=â : cannot convert from âconst mediump floatâ to âhighp 4-component vector of floatâ

I am trying to find the changes between r106 and r111 but couldnt find a solution. I think this shader material also doesnt work in safari altough it is in r106. I am sure i am doing really bad mistakes but i am not good at glsl. Stuck hereâŚ

Note: I already define âdefinesâ and i set .extensions.derivatives = true

defines[ âUSE_MAPâ ] = ââ;

defines[ âUSE_NORMALMAPâ ] = ââ;

defines[ âUSE_LIGHTMAPâ ] = ââ;

Your help is appreciated

Thanks!