Shader error Overflow in implicit constant conversion, minimum range for lowp float is (-2,2)

When rendering this viewer link on an iOS device I’m getting this error message on console:

THREE.WebGLProgram: shader error: 0 35715 false gl.getProgramInfoLog WARNING: 0:340: Overflow in implicit constant conversion, minimum range for lowp float is (-2,2)

Before that error console message I’m getting this warning message (to long to include here but looks like a part of a GLSL-shader code):

And after those messages I’m getting this error message hundreds of times:

[native code]:1 WebGL: INVALID_OPERATION: useProgram: program not valid

Might be an Apple problem (both Chrome and Safari on iOS) but could also be a bug on the shader:

Any ideas?

Thank you.

If so, then it’s necessary to find the problematic part of the shader. In your linked warning message the errors occurs in the dithering shader chunk although the shader is not configured to use the particular code since the related define DITHERING is not set. Same for the other warning that refers to a line related to area lights. But it looks like no area lights are defined in your scene. Probably the line numbers are not correct?

Do you have this issue only with MeshStandardMaterial and MeshPhysicalMaterial or also with other materials.

We are usually using glTF files exported from substance painter so MeshStandardMaterial is the majority of our models.

Unfortunately, I don’t have an iOS device at hand so I’m able to verify this issue. In any event, your last post did not answer by question^^. So please test all “variation” examples and note what materials produce the mentioned warning. In this way, it’s hopefully possible to isolate the issue a bit.

https://threejs.org/examples/?q=variations

Unfortunately, that’s not an easy question for me to answer.

Looks like I cannot reproduce this issue with MeshPhongMaterial.

Another curious fact is the issue doesn’t reproduce without the plane=1 parameter.

The plane parameter is invoking this function:

var planeGeometry = new THREE.PlaneBufferGeometry(100, 100, 1, 1);

var planeMaterial = new THREE.ShadowMaterial({ color: new THREE.Color('0x000000'), transparent: true, opacity: 1 });

var plane = new THREE.Mesh(planeGeometry, planeMaterial);

plane.receiveShadow = true;

plane.rotation.x = - Math.PI * 0.5;

scene.add(plane);

plane.position.y = 30;

I use it for shadow effect (this is not exactly the way this function is written but a simplification of the original one).

I’ve tried to change the plane color and to delay the function but the result was the same.

Hope this helps in some way.

Please let me know if you have anything else you want me to check.

My uneducated guess is this line:

dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );

from src/renderers/shaders/ShaderChunk/dithering_pars_fragment.glsl.js

If extracted the related code to this fiddle: https://jsfiddle.net/fwbd3gk0/

Do you see a shader error?

Running this code on an iOS device didn’t cause any errors, but should it always?

Maybe that’s some extreme case?

Please try it once again with this update fiddle: Edit fiddle - JSFiddle - Code Playground

I removed the usage of rand() and now use the highest possible value (1.0). If this fiddle runs fine, I think the issue has to be elsewhere.

image

Nothing on the console.

About the first link that I’ve shared here, I’m uploading a hotfix to my production environment (ignoring the plane parameter) so the issue may not show there anymore.

In this link you can still see the issue live on iOS devices.