Threejs r111 it normal but threejs r131 it error Using shaderMaterial.error:'mapTexelToLinear' : no matching

Hello
I am using the threejs r131.It gives the error message
mapTexelToLinear: no matching overloaded function found
But I change threejs r131 to threejs r111. The demo normal
I haven’t found the reason
The code is a little messy because it is temporary demo
ShaderDemo ThreejsR111
ShaderDemo ThreejsR131
ShaderDemo Code
Could you help me look at this demo
The console error

three.module.js:18434 THREE.WebGLProgram: shader error: 0 35715 false gl.getProgramInfoLog Fragment shader is not compiled.HREE.WebGLShader: gl.getShaderInfoLog() fragment
ERROR: 0:577: ‘mapTexelToLinear’ : no matching overloaded function found …

update

I go to stackoverflow than find the reason
standardMaterial using shaderMaterial. USE_MAP suddenly stopped working, “maptexelToLinear; no matching overloaded function found”
Mugen87 Modify according to the answer.
I delete code defines: { USE_MAP: true, USE_UV: true } than add code shaderMaterial.map = texture.
The threejs r131 no error. But it update to threejs r132 and create new error ‘vNormal’ : undeclared identifier. oh help.

Hello! In three.js fragment shader is:

vec4 LinearToLinear( in vec4 value ) { return value; }
vec4 mapTexelToLinear( vec4 value ) { return LinearToLinear( value ); }

Just add it or not because it return same value.

Hello
The Threejs r111 Demo
ShaderDemo ThreejsR111

Thank you.But I change threejs r131 to r111. The ShaderDemo normal and no error.

Please update your app so this error gets logged.

Also note that implementing custom shader materials by reusing shader chunks is error prone unless you really know what you are doing. I have not studied your code in detail but it seems the runtime error is produces by boundingMesh.js (meaning its custom shader). The shader chunks your are using there are probably not compatible with the latest version of three.js.

Thank you Mugen87. I haved update my app.I find the threejs r131 no error. But I update the threejs r132 and the error ‘vNormal’ : undeclared identifier .

Try adding the new normal_pars_vertex, normal_pars_fragment and normal_vertex shader chunks to your custom shader. These chunks were introduced with r132. Update your code similar to the respective PR:

2 Likes

Thanks so much Mugen87. this is perfect and solve the problem

1 Like