MeshPhysicalMaterial with R145 and later

I have run into an issue with MeshPhsicalMaterial after R144. I was updating to 147 and tracked back it started in 145. It came down to having a transmission setting greater than 0. If I set it to anything above that it fails with a shader error. All else seems to work fine, but now I cant do glass and other such things with the error.

I am using standard es5 code with three.js not module. The error in console is this

THREE.WebGLProgram: Shader Error 1282 - VALIDATE_STATUS false

Program Info Log: Fragment shader is not compiled.


FRAGMENT

ERROR: 0:885: 'isinf' : no matching overloaded function found
ERROR: 0:885: '' : boolean expression expected


  880: 		#else
  881: 			return texture2D( transmissionSamplerMap, fragCoord.xy, framebufferLod );
  882: 		#endif
  883: 	}
  884: 	vec3 applyVolumeAttenuation( const in vec3 radiance, const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {
> 885: 		if ( isinf( attenuationDistance ) ) {
  886: 			return radiance;
  887: 		} else {
  888: 			vec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;
  889: 			vec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );			return transmittance * radiance;
  890: 		}
  891: 	}
THREE.WebGLProgram: Shader Error 1282 - VALIDATE_STATUS false

Program Info Log: Fragment shader is not compiled.


FRAGMENT

ERROR: 0:886: 'isinf' : no matching overloaded function found
ERROR: 0:886: '' : boolean expression expected


  881: 		#else
  882: 			return texture2D( transmissionSamplerMap, fragCoord.xy, framebufferLod );
  883: 		#endif
  884: 	}
  885: 	vec3 applyVolumeAttenuation( const in vec3 radiance, const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {
> 886: 		if ( isinf( attenuationDistance ) ) {
  887: 			return radiance;
  888: 		} else {
  889: 			vec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;
  890: 			vec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );			return transmittance * radiance;
  891: 		}
  892: 	}
THREE.WebGLProgram: Shader Error 1282 - VALIDATE_STATUS false

Program Info Log: Fragment shader is not compiled.


FRAGMENT

ERROR: 0:885: 'isinf' : no matching overloaded function found
ERROR: 0:885: '' : boolean expression expected


  880: 		#else
  881: 			return texture2D( transmissionSamplerMap, fragCoord.xy, framebufferLod );
  882: 		#endif
  883: 	}
  884: 	vec3 applyVolumeAttenuation( const in vec3 radiance, const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {
> 885: 		if ( isinf( attenuationDistance ) ) {
  886: 			return radiance;
  887: 		} else {
  888: 			vec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;
  889: 			vec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );			return transmittance * radiance;
  890: 		}
  891: 	}

Is the Shader code for Physical in the main three js file or external?

this is the code I use

 		   	 	var GlassnormalMap = loader.load("content/glass/normal.jpg");
	   	    	if (IVS_normalMap[num])
	    			 GlassnormalMap = IVS_normalMap[num];
 				Object_Material[num] = new THREE.MeshPhysicalMaterial({
    				color: shinecolor,

    				metalness: metalness,
    				roughness: roughness,
    				opacity: Object_Opacity,
    				thickness: 6,
    				clearcoat: 1,
    				clearcoatRoughness:  0.1,
     				clearcoatNormalScale: new THREE.Vector2(0.2),
   					reflectivity: envmap,
    				transparent : true, 
     				envMap: envmapimage,
    				envMapIntensity: envmap,
    				normalScale: new THREE.Vector2( normalscale, normalscale ),   
    				normalMap: GlassnormalMap,
    				ior: 1.8,
        				clearcoatNormalMap: GlassnormalMap,
				transmission: transmission,
/*
error on transmission
 */
 
   				});

As I said it works just fine up to 145 but then I get these errors when I set transmission

Any ideas?

Jeff

I guess this topic is a duplicate of:

1 Like

well still seems to be an issue, but not sure if a fix has been found. The reason I was using webgl1 is that there is a bug in chrome on the MAC that does the following to some objects

The issue would work if I did this on MACs using Chrome
IVS_Renderer = new THREE.WebGL1Renderer( {antialias:true,alpha: true,preserveDrawingBuffer: true , logarithmicDepthBuffer: false } );

but now that same line is what crashes the shader for glass and transmission

so I guess this is a google issue to fix, unless someone knows of another way