Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shader error when loading glb models #11

Closed
Sceat opened this issue Mar 17, 2024 · 1 comment · Fixed by #46
Closed

Shader error when loading glb models #11

Sceat opened this issue Mar 17, 2024 · 1 comment · Fixed by #46
Assignees
Labels
bug Aw snap!

Comments

@Sceat
Copy link
Member

Sceat commented Mar 17, 2024

This weird errors appears while loading the glb characters models

THREE.WebGLProgram: Shader Error 0 - VALIDATE_STATUS false

Material Name: 
Material Type: MeshDepthMaterial

Program Info Log: Vertex shader is not compiled.
�
VERTEX

ERROR: 0:448: 'MORPHTARGETS_COUNT' : undeclared identifier
ERROR: 0:448: '' : array size must be a constant integer expression
ERROR: 0:450: 'MORPHTARGETS_COUNT' : undeclared identifier
ERROR: 0:450: '<' : wrong operand types - no operation '<' exists that takes a left-hand operand of type 'highp int' and a right operand of type 'const highp float' (or there is no acceptable conversion)
�

  443: 	mat4 boneMatY = getBoneMatrix( skinIndex.y );
  444: 	mat4 boneMatZ = getBoneMatrix( skinIndex.z );
  445: 	mat4 boneMatW = getBoneMatrix( skinIndex.w );
  446: #endif
  447: #ifdef USE_INSTANCING_MORPH
> 448: 	float morphTargetInfluences[MORPHTARGETS_COUNT];
  449: 	float morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r;
  450: 	for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
  451: 		morphTargetInfluences[i] =  texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r;
  452: 	}
  453: #endif
  454: 	#ifdef USE_DISPLACEMENTMAP

It is often hidden (for ease of development) by using

renderer.debug.checkShaderErrors = false

@Sceat Sceat added the bug Aw snap! label Mar 17, 2024
@piellardj piellardj self-assigned this Mar 18, 2024
@piellardj piellardj linked a pull request Mar 18, 2024 that will close this issue
@piellardj
Copy link
Member

I believe this is a bug introduced in three.js v162 (see mrdoob/three.js#27669).
Here is a PR to add a workaround: #46

@Sceat Sceat closed this as completed in #46 Mar 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Aw snap!
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants