three-csm icon indicating copy to clipboard operation
three-csm copied to clipboard

program not valid with latest three.js

Open aiden-jeffrey opened this issue 1 year ago • 9 comments

I'm seeing this error trying to use your library on a recent three.js release (r157):

three.module.js:19999 THREE.WebGLProgram: Shader Error 0 - VALIDATE_STATUS false

Program Info Log: Fragment shader is not compiled.
 

FRAGMENT

ERROR: 0:1591: 'GeometricContext' : undeclared identifier
ERROR: 0:1591: 'geometry' : syntax error
 

  1586: 	material.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) );
  1587: 	material.anisotropyT = tbn[ 0 ] * anisotropyV.x - tbn[ 1 ] * anisotropyV.y;
  1588: 	material.anisotropyB = tbn[ 1 ] * anisotropyV.x + tbn[ 0 ] * anisotropyV.y;
  1589: #endif
  1590: 
> 1591: GeometricContext geometry;
  1592: 
  1593: geometry.position = - vViewPosition;
  1594: geometry.normal = normal;
  1595: geometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );
  1596: 
  1597: #ifdef CLEARCOAT

Any idea what I can do to fix this? Should I just use the version of this that ships with three.js?

aiden-jeffrey avatar Nov 07 '23 11:11 aiden-jeffrey