CesiumGS / cesium

An open-source JavaScript library for world-class 3D globes and maps :earth_americas:
https://cesium.com/cesiumjs/
Apache License 2.0
13.04k stars 3.51k forks source link

Import glb file receive error to_many_attributes #11307

Closed brunokunace closed 1 year ago

brunokunace commented 1 year ago

Hi, iam using this code example: https://sandcastle.cesium.com/?src=3D%20Models.html

but passing other glb file instead, and receive this error: GLB FILE EXAMPLE: https://dev.storage.superviz.com/readyplayerme/1.glb

[Cesium WebGL] Shader program link log: Too many attributes (a_targetPosition_11)

[Cesium WebGL] Translated vertex shaderSource:
#version 410
uniform vec2 _uczm_currentFrustum;
uniform mat4 _uczm_inverseProjection;
out float _uv_depthFromNearPlusOne;
out vec3 _uv_logPositionEC;
vec4 _uczm_updatePositionDepth(in vec4 _ucoords){
  vec3 _ulogPositionEC = (_uczm_inverseProjection * _ucoords).xyz;
  (_uv_logPositionEC = _ulogPositionEC);
  (_ucoords.z = (clamp((_ucoords.z / _ucoords.w), -1.0, 1.0) * _ucoords.w));
  return _ucoords;
}
void _uczm_vertexLogDepth(){
  (_uv_depthFromNearPlusOne = ((gl_Position.w - _uczm_currentFrustum.x) + 1.0));
  (gl_Position = _uczm_updatePositionDepth(gl_Position));
}
uniform mat3 _uczm_normal;
uniform mat4 _uczm_modelView;
uniform mat3 _uczm_normal3D;
uniform mat4 _uczm_modelView3D;
uniform mat4 _uczm_model;
uniform mat4 _uczm_projection;
in vec3 _ua_positionMC;
in vec3 _ua_normalMC;
in vec2 _ua_texCoord_0;
in vec4 _ua_joints_0;
in vec4 _ua_weights_0;
in vec3 _ua_targetPosition_0;
in vec3 _ua_targetPosition_1;
in vec3 _ua_targetPosition_2;
in vec3 _ua_targetPosition_3;
in vec3 _ua_targetPosition_4;
in vec3 _ua_targetPosition_5;
in vec3 _ua_targetPosition_6;
in vec3 _ua_targetPosition_7;
in vec3 _ua_targetPosition_8;
in vec3 _ua_targetPosition_9;
in vec3 _ua_targetPosition_10;
in vec3 _ua_targetPosition_11;
in vec3 _ua_targetPosition_12;
in vec3 _ua_targetPosition_13;
in vec3 _ua_targetPosition_14;
in vec3 _ua_targetPosition_15;
in vec3 _ua_targetPosition_16;
in vec3 _ua_targetPosition_17;
in vec3 _ua_targetPosition_18;
in vec3 _ua_targetPosition_19;
in vec3 _ua_targetPosition_20;
in vec3 _ua_targetPosition_21;
in vec3 _ua_targetPosition_22;
in vec3 _ua_targetPosition_23;
in vec3 _ua_targetPosition_24;
in vec3 _ua_targetPosition_25;
in vec3 _ua_targetPosition_26;
in vec3 _ua_targetPosition_27;
in vec3 _ua_targetPosition_28;
in vec3 _ua_targetPosition_29;
in vec3 _ua_targetPosition_30;
in vec3 _ua_targetPosition_31;
in vec3 _ua_targetPosition_32;
in vec3 _ua_targetPosition_33;
in vec3 _ua_targetPosition_34;
in vec3 _ua_targetPosition_35;
in vec3 _ua_targetPosition_36;
in vec3 _ua_targetPosition_37;
in vec3 _ua_targetPosition_38;
in vec3 _ua_targetPosition_39;
in vec3 _ua_targetPosition_40;
in vec3 _ua_targetPosition_41;
in vec3 _ua_targetPosition_42;
in vec3 _ua_targetPosition_43;
in vec3 _ua_targetPosition_44;
in vec3 _ua_targetPosition_45;
in vec3 _ua_targetPosition_46;
in vec3 _ua_targetPosition_47;
in vec3 _ua_targetPosition_48;
in vec3 _ua_targetPosition_49;
in vec3 _ua_targetPosition_50;
in vec3 _ua_targetPosition_51;
in vec3 _ua_targetPosition_52;
in vec3 _ua_targetPosition_53;
in vec3 _ua_targetPosition_54;
in vec3 _ua_targetPosition_55;
in vec3 _ua_targetPosition_56;
in vec3 _ua_targetPosition_57;
in vec3 _ua_targetPosition_58;
in vec3 _ua_targetPosition_59;
in vec3 _ua_targetPosition_60;
in vec3 _ua_targetPosition_61;
in vec3 _ua_targetPosition_62;
in vec3 _ua_targetPosition_63;
in vec3 _ua_targetPosition_64;
in vec3 _ua_targetPosition_65;
in vec3 _ua_targetPosition_66;
in vec3 _ua_targetPosition_67;
in vec3 _ua_targetPosition_68;
in vec3 _ua_targetPosition_69;
in vec3 _ua_targetPosition_70;
in vec3 _ua_targetPosition_71;
uniform float _uu_morphWeights[72];
uniform mat4 _uu_jointMatrices[38];
out vec3 _uv_positionWC;
out vec3 _uv_positionEC;
out vec3 _uv_positionMC;
out vec3 _uv_normalEC;
out vec2 _uv_texCoord_0;
out vec4 _uv_joints_0;
out vec4 _uv_weights_0;
struct _uProcessedAttributes {
  vec3 _upositionMC;
  vec3 _unormalMC;
  vec2 _utexCoord_0;
  vec4 _ujoints_0;
  vec4 _uweights_0;
};
struct _uFeatureIds {
  float _u_empty;
};
struct _uMetadata {
  float _u_empty;
};
struct _uMetadataClass {
  float _u_empty;
};
struct _uMetadataStatistics {
  float _u_empty;
};
void _uinitializeAttributes(out _uProcessedAttributes _uattributes){
  (_uattributes._upositionMC = _ua_positionMC);
  (_uattributes._unormalMC = _ua_normalMC);
  (_uattributes._utexCoord_0 = _ua_texCoord_0);
  (_uattributes._ujoints_0 = _ua_joints_0);
  (_uattributes._uweights_0 = _ua_weights_0);
}
void _usetDynamicVaryings(inout _uProcessedAttributes _uattributes){
  (_uv_texCoord_0 = _uattributes._utexCoord_0);
  (_uv_joints_0 = _uattributes._ujoints_0);
  (_uv_weights_0 = _uattributes._uweights_0);
}
vec3 _ugetMorphedPosition(in vec3 _uposition){
  vec3 _umorphedPosition = _uposition;
  (_umorphedPosition += (_uu_morphWeights[0] * _ua_targetPosition_0));
  (_umorphedPosition += (_uu_morphWeights[1] * _ua_targetPosition_1));
  (_umorphedPosition += (_uu_morphWeights[2] * _ua_targetPosition_2));
  (_umorphedPosition += (_uu_morphWeights[3] * _ua_targetPosition_3));
  (_umorphedPosition += (_uu_morphWeights[4] * _ua_targetPosition_4));
  (_umorphedPosition += (_uu_morphWeights[5] * _ua_targetPosition_5));
  (_umorphedPosition += (_uu_morphWeights[6] * _ua_targetPosition_6));
  (_umorphedPosition += (_uu_morphWeights[7] * _ua_targetPosition_7));
  (_umorphedPosition += (_uu_morphWeights[8] * _ua_targetPosition_8));
  (_umorphedPosition += (_uu_morphWeights[9] * _ua_targetPosition_9));
  (_umorphedPosition += (_uu_morphWeights[10] * _ua_targetPosition_10));
  (_umorphedPosition += (_uu_morphWeights[11] * _ua_targetPosition_11));
  (_umorphedPosition += (_uu_morphWeights[12] * _ua_targetPosition_12));
  (_umorphedPosition += (_uu_morphWeights[13] * _ua_targetPosition_13));
  (_umorphedPosition += (_uu_morphWeights[14] * _ua_targetPosition_14));
  (_umorphedPosition += (_uu_morphWeights[15] * _ua_targetPosition_15));
  (_umorphedPosition += (_uu_morphWeights[16] * _ua_targetPosition_16));
  (_umorphedPosition += (_uu_morphWeights[17] * _ua_targetPosition_17));
  (_umorphedPosition += (_uu_morphWeights[18] * _ua_targetPosition_18));
  (_umorphedPosition += (_uu_morphWeights[19] * _ua_targetPosition_19));
  (_umorphedPosition += (_uu_morphWeights[20] * _ua_targetPosition_20));
  (_umorphedPosition += (_uu_morphWeights[21] * _ua_targetPosition_21));
  (_umorphedPosition += (_uu_morphWeights[22] * _ua_targetPosition_22));
  (_umorphedPosition += (_uu_morphWeights[23] * _ua_targetPosition_23));
  (_umorphedPosition += (_uu_morphWeights[24] * _ua_targetPosition_24));
  (_umorphedPosition += (_uu_morphWeights[25] * _ua_targetPosition_25));
  (_umorphedPosition += (_uu_morphWeights[26] * _ua_targetPosition_26));
  (_umorphedPosition += (_uu_morphWeights[27] * _ua_targetPosition_27));
  (_umorphedPosition += (_uu_morphWeights[28] * _ua_targetPosition_28));
  (_umorphedPosition += (_uu_morphWeights[29] * _ua_targetPosition_29));
  (_umorphedPosition += (_uu_morphWeights[30] * _ua_targetPosition_30));
  (_umorphedPosition += (_uu_morphWeights[31] * _ua_targetPosition_31));
  (_umorphedPosition += (_uu_morphWeights[32] * _ua_targetPosition_32));
  (_umorphedPosition += (_uu_morphWeights[33] * _ua_targetPosition_33));
  (_umorphedPosition += (_uu_morphWeights[34] * _ua_targetPosition_34));
  (_umorphedPosition += (_uu_morphWeights[35] * _ua_targetPosition_35));
  (_umorphedPosition += (_uu_morphWeights[36] * _ua_targetPosition_36));
  (_umorphedPosition += (_uu_morphWeights[37] * _ua_targetPosition_37));
  (_umorphedPosition += (_uu_morphWeights[38] * _ua_targetPosition_38));
  (_umorphedPosition += (_uu_morphWeights[39] * _ua_targetPosition_39));
  (_umorphedPosition += (_uu_morphWeights[40] * _ua_targetPosition_40));
  (_umorphedPosition += (_uu_morphWeights[41] * _ua_targetPosition_41));
  (_umorphedPosition += (_uu_morphWeights[42] * _ua_targetPosition_42));
  (_umorphedPosition += (_uu_morphWeights[43] * _ua_targetPosition_43));
  (_umorphedPosition += (_uu_morphWeights[44] * _ua_targetPosition_44));
  (_umorphedPosition += (_uu_morphWeights[45] * _ua_targetPosition_45));
  (_umorphedPosition += (_uu_morphWeights[46] * _ua_targetPosition_46));
  (_umorphedPosition += (_uu_morphWeights[47] * _ua_targetPosition_47));
  (_umorphedPosition += (_uu_morphWeights[48] * _ua_targetPosition_48));
  (_umorphedPosition += (_uu_morphWeights[49] * _ua_targetPosition_49));
  (_umorphedPosition += (_uu_morphWeights[50] * _ua_targetPosition_50));
  (_umorphedPosition += (_uu_morphWeights[51] * _ua_targetPosition_51));
  (_umorphedPosition += (_uu_morphWeights[52] * _ua_targetPosition_52));
  (_umorphedPosition += (_uu_morphWeights[53] * _ua_targetPosition_53));
  (_umorphedPosition += (_uu_morphWeights[54] * _ua_targetPosition_54));
  (_umorphedPosition += (_uu_morphWeights[55] * _ua_targetPosition_55));
  (_umorphedPosition += (_uu_morphWeights[56] * _ua_targetPosition_56));
  (_umorphedPosition += (_uu_morphWeights[57] * _ua_targetPosition_57));
  (_umorphedPosition += (_uu_morphWeights[58] * _ua_targetPosition_58));
  (_umorphedPosition += (_uu_morphWeights[59] * _ua_targetPosition_59));
  (_umorphedPosition += (_uu_morphWeights[60] * _ua_targetPosition_60));
  (_umorphedPosition += (_uu_morphWeights[61] * _ua_targetPosition_61));
  (_umorphedPosition += (_uu_morphWeights[62] * _ua_targetPosition_62));
  (_umorphedPosition += (_uu_morphWeights[63] * _ua_targetPosition_63));
  (_umorphedPosition += (_uu_morphWeights[64] * _ua_targetPosition_64));
  (_umorphedPosition += (_uu_morphWeights[65] * _ua_targetPosition_65));
  (_umorphedPosition += (_uu_morphWeights[66] * _ua_targetPosition_66));
  (_umorphedPosition += (_uu_morphWeights[67] * _ua_targetPosition_67));
  (_umorphedPosition += (_uu_morphWeights[68] * _ua_targetPosition_68));
  (_umorphedPosition += (_uu_morphWeights[69] * _ua_targetPosition_69));
  (_umorphedPosition += (_uu_morphWeights[70] * _ua_targetPosition_70));
  (_umorphedPosition += (_uu_morphWeights[71] * _ua_targetPosition_71));
  return _umorphedPosition;
}
vec3 _ugetMorphedNormal(in vec3 _unormal){
  vec3 _umorphedNormal = _unormal;
  return _umorphedNormal;
}
mat4 _ugetSkinningMatrix(){
  mat4 _uskinnedMatrix = mat4(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
  (_uskinnedMatrix += (_ua_weights_0.x * _uu_jointMatrices[int(clamp(float(int(_ua_joints_0.x)), 0.0, 37.0))]));
  (_uskinnedMatrix += (_ua_weights_0.y * _uu_jointMatrices[int(clamp(float(int(_ua_joints_0.y)), 0.0, 37.0))]));
  (_uskinnedMatrix += (_ua_weights_0.z * _uu_jointMatrices[int(clamp(float(int(_ua_joints_0.z)), 0.0, 37.0))]));
  (_uskinnedMatrix += (_ua_weights_0.w * _uu_jointMatrices[int(clamp(float(int(_ua_joints_0.w)), 0.0, 37.0))]));
  return _uskinnedMatrix;
}
void _uinitializeFeatureIds(out _uFeatureIds _ufeatureIds, in _uProcessedAttributes _uattributes){
}
void _uinitializeFeatureIdAliases(inout _uFeatureIds _ufeatureIds){
}
void _usetFeatureIdVaryings(){
}
void _uinitializeMetadata(out _uMetadata _umetadata, out _uMetadataClass _umetadataClass, out _uMetadataStatistics _umetadataStatistics, in _uProcessedAttributes _uattributes){
}
void _usetMetadataVaryings(){
}
vec4 _ugeometryStage(inout _uProcessedAttributes _uattributes, in mat4 _umodelView, in mat3 _unormal){
  vec4 _ucomputedPosition = vec4(0.0, 0.0, 0.0, 0.0);
  vec3 _upositionMC = _uattributes._upositionMC;
  (_uv_positionMC = _upositionMC);
  (_uv_positionEC = (_umodelView * vec4(_upositionMC, 1.0)).xyz);
  (_ucomputedPosition = (_uczm_projection * vec4(_uv_positionEC, 1.0)));
  (_uv_normalEC = normalize((_unormal * _uattributes._unormalMC)));
  _usetDynamicVaryings(_uattributes);
  return _ucomputedPosition;
}
void _umorphTargetsStage(inout _uProcessedAttributes _uattributes){
  vec3 _upositionMC = _uattributes._upositionMC;
  (_uattributes._upositionMC = _ugetMorphedPosition(_upositionMC));
  vec3 _unormalMC = _uattributes._unormalMC;
  (_uattributes._unormalMC = _ugetMorphedNormal(_unormalMC));
}
void _uskinningStage(inout _uProcessedAttributes _uattributes){
  mat4 _uskinningMatrix = _ugetSkinningMatrix();
  mat3 _uskinningMatrixMat3 = mat3(_uskinningMatrix);
  vec4 _upositionMC = vec4(_uattributes._upositionMC, 1.0);
  (_uattributes._upositionMC = vec3((_uskinningMatrix * _upositionMC)));
  vec3 _unormalMC = _uattributes._unormalMC;
  (_uattributes._unormalMC = (_uskinningMatrixMat3 * _unormalMC));
}
void _ufeatureIdStage(out _uFeatureIds _ufeatureIds, in _uProcessedAttributes _uattributes){
  _uinitializeFeatureIds(_ufeatureIds, _uattributes);
  _uinitializeFeatureIdAliases(_ufeatureIds);
  _usetFeatureIdVaryings();
}
void _umetadataStage(out _uMetadata _umetadata, out _uMetadataClass _umetadataClass, out _uMetadataStatistics _umetadataStatistics, in _uProcessedAttributes _uattributes){
  _uinitializeMetadata(_umetadata, _umetadataClass, _umetadataStatistics, _uattributes);
  _usetMetadataVaryings();
}
void _uczm_log_depth_main(){
  _uProcessedAttributes _uattributes = _uProcessedAttributes(vec3(0.0, 0.0, 0.0), vec3(0.0, 0.0, 0.0), vec2(0.0, 0.0), vec4(0.0, 0.0, 0.0, 0.0), vec4(0.0, 0.0, 0.0, 0.0));
  _uinitializeAttributes(_uattributes);
  _umorphTargetsStage(_uattributes);
  _uskinningStage(_uattributes);
  _uFeatureIds _ufeatureIds = _uFeatureIds(0.0);
  _ufeatureIdStage(_ufeatureIds, _uattributes);
  mat4 _umodelView = _uczm_modelView;
  mat3 _unormal = _uczm_normal;
  _uMetadata _umetadata = _uMetadata(0.0);
  _uMetadataClass _umetadataClass = _uMetadataClass(0.0);
  _uMetadataStatistics _umetadataStatistics = _uMetadataStatistics(0.0);
  _umetadataStage(_umetadata, _umetadataClass, _umetadataStatistics, _uattributes);
  vec4 _upositionClip = _ugeometryStage(_uattributes, _umodelView, _unormal);
  float _ushow = 1.0;
  (gl_Position = (_ushow * _upositionClip));
}
void main(){
  (_uv_weights_0 = vec4(0.0, 0.0, 0.0, 0.0));
  (_uv_joints_0 = vec4(0.0, 0.0, 0.0, 0.0));
  (_uv_texCoord_0 = vec2(0.0, 0.0));
  (_uv_normalEC = vec3(0.0, 0.0, 0.0));
  (_uv_positionMC = vec3(0.0, 0.0, 0.0));
  (_uv_positionEC = vec3(0.0, 0.0, 0.0));
  (_uv_positionWC = vec3(0.0, 0.0, 0.0));
  (gl_Position = vec4(0.0, 0.0, 0.0, 0.0));
  (_uv_logPositionEC = vec3(0.0, 0.0, 0.0));
  (_uv_depthFromNearPlusOne = 0.0);
  _uczm_log_depth_main();
  _uczm_vertexLogDepth();
}

[Cesium WebGL] Translated fragment shaderSource:
#version 410
void initGlobals();
layout(location = 0) out vec4 _uout_FragColor;
vec4 _uczm_textureCube(in samplerCube _usampler, in vec3 _up){
  return texture(_usampler, _up);
}
float _uczm_sampleShadowMap(in sampler2D _ushadowMap, in vec2 _uuv){
  return texture(_ushadowMap, _uuv).x;
}
float _uczm_shadowDepthCompare(in sampler2D _ushadowMap, in vec2 _uuv, in float _udepth){
  return step(_udepth, _uczm_sampleShadowMap(_ushadowMap, _uuv));
}
struct _uczm_shadowParameters {
  vec2 _utexCoords;
  float _udepthBias;
  float _udepth;
  float _unDotL;
  vec2 _utexelStepSize;
  float _unormalShadingSmooth;
  float _udarkness;
};
uniform float _uczm_oneOverLog2FarDepthFromNearPlusOne;
uniform float _uczm_farDepthFromNearPlusOne;
uniform float _uczm_gamma;
struct _uczm_pbrParameters {
  vec3 _udiffuseColor;
  float _uroughness;
  vec3 _uf0;
};
float _uczm_private_shadowVisibility(in float _uvisibility, in float _unDotL, in float _unormalShadingSmooth, in float _udarkness){
  float _ustrength = clamp((_unDotL / _unormalShadingSmooth), 0.0, 1.0);
  (_uvisibility *= _ustrength);
  (_uvisibility = max(_uvisibility, _udarkness));
  return _uvisibility;
}
float _uczm_shadowVisibility(in sampler2D _ushadowMap, in _uczm_shadowParameters _ushadowParameters){
  float _udepthBias = _ushadowParameters._udepthBias;
  float _udepth = _ushadowParameters._udepth;
  float _unDotL = _ushadowParameters._unDotL;
  float _unormalShadingSmooth = _ushadowParameters._unormalShadingSmooth;
  float _udarkness = _ushadowParameters._udarkness;
  vec2 _uuv = _ushadowParameters._utexCoords;
  (_udepth -= _udepthBias);
  float _uvisibility = _uczm_shadowDepthCompare(_ushadowMap, _uuv, _udepth);
  return _uczm_private_shadowVisibility(_uvisibility, _unDotL, _unormalShadingSmooth, _udarkness);
}
uniform mat4 _ushadowMap_cascadeMatrices[4];
mat4 _uczm_cascadeMatrix(in vec4 _uweights){
  return ((((_ushadowMap_cascadeMatrices[0] * _uweights.x) + (_ushadowMap_cascadeMatrices[1] * _uweights.y)) + (_ushadowMap_cascadeMatrices[2] * _uweights.z)) + (_ushadowMap_cascadeMatrices[3] * _uweights.w));
}
uniform vec4 _ushadowMap_cascadeSplits[2];
vec4 _uczm_cascadeWeights(in float _udepthEye){
  vec4 _unear = step(_ushadowMap_cascadeSplits[0], vec4(_udepthEye));
  vec4 _ufar = step(_udepthEye, _ushadowMap_cascadeSplits[1]);
  return (_unear * _ufar);
}
in float _uv_depthFromNearPlusOne;
void _uczm_writeLogDepth(in float _udepth){
  if ((((_udepth <= 0.99999988)) ? (true) : ((_udepth > _uczm_farDepthFromNearPlusOne))))
  {
    discard;
  }
  (gl_FragDepth = (log2(_udepth) * _uczm_oneOverLog2FarDepthFromNearPlusOne));
}
void _uczm_writeLogDepth(){
  _uczm_writeLogDepth(_uv_depthFromNearPlusOne);
}
vec3 _uczm_linearToSrgb(in vec3 _ulinearIn){
  return pow(_ulinearIn, vec3(0.45454544, 0.45454544, 0.45454544));
}
vec3 _uczm_acesTonemapping(in vec3 _ucolor){
  float _ug = 0.98500001;
  float _ua = 0.064999998;
  float _ub = 9.9999997e-05;
  float _uc = 0.433;
  float _ud = 0.23800001;
  (_ucolor = (((_ucolor * (_ucolor + _ua)) - _ub) / ((_ucolor * ((_ug * _ucolor) + _uc)) + _ud)));
  (_ucolor = clamp(_ucolor, 0.0, 1.0));
  return _ucolor;
}
uniform vec3 _uczm_lightDirectionEC;
vec3 _ulambertianDiffuse(in vec3 _udiffuseColor){
  return (_udiffuseColor / 3.1415927);
}
vec3 _ufresnelSchlick2(in vec3 _uf0, in vec3 _uf90, in float _uVdotH){
  return (_uf0 + ((_uf90 - _uf0) * pow(clamp((1.0 - _uVdotH), 0.0, 1.0), 5.0)));
}
float _usmithVisibilityG1(in float _uNdotV, in float _uroughness){
  float _uk = (((_uroughness + 1.0) * (_uroughness + 1.0)) / 8.0);
  return (_uNdotV / ((_uNdotV * (1.0 - _uk)) + _uk));
}
float _usmithVisibilityGGX(in float _uroughness, in float _uNdotL, in float _uNdotV){
  return (_usmithVisibilityG1(_uNdotL, _uroughness) * _usmithVisibilityG1(_uNdotV, _uroughness));
}
float _uGGX(in float _uroughness, in float _uNdotH){
  float _uroughnessSquared = (_uroughness * _uroughness);
  float _uf = ((((_uNdotH * _uroughnessSquared) - _uNdotH) * _uNdotH) + 1.0);
  return (_uroughnessSquared / ((3.1415927 * _uf) * _uf));
}
vec3 _uczm_pbrLighting(in vec3 _upositionEC, in vec3 _unormalEC, in vec3 _ulightDirectionEC, in vec3 _ulightColorHdr, in _uczm_pbrParameters _upbrParameters){
  vec3 _uv = (-normalize(_upositionEC));
  vec3 _ul = normalize(_ulightDirectionEC);
  vec3 _uh = normalize((_uv + _ul));
  vec3 _un = _unormalEC;
  float _uNdotL = clamp(dot(_un, _ul), 0.001, 1.0);
  float _uNdotV = (abs(dot(_un, _uv)) + 0.001);
  float _uNdotH = clamp(dot(_un, _uh), 0.0, 1.0);
  float _uVdotH = clamp(dot(_uv, _uh), 0.0, 1.0);
  vec3 _uf0 = _upbrParameters._uf0;
  float _ureflectance = max(max(_uf0.x, _uf0.y), _uf0.z);
  vec3 _uf90 = vec3(clamp((_ureflectance * 25.0), 0.0, 1.0));
  vec3 _uF = _ufresnelSchlick2(_uf0, _uf90, _uVdotH);
  float _ualpha = _upbrParameters._uroughness;
  float _uG = _usmithVisibilityGGX(_ualpha, _uNdotL, _uNdotV);
  float _uD = _uGGX(_ualpha, _uNdotH);
  vec3 _uspecularContribution = (((_uF

  An error occurred while rendering.  Rendering has stopped.
RuntimeError: Program failed to link.  Link log: Too many attributes (a_targetPosition_11)
ggetz commented 1 year ago

@jjhembd Would you be able to triage this issue?

jjhembd commented 1 year ago

Hi @brunokunace, could you please visit https://webglreport.com/?v=2 and post a screenshot of the results?

My first guess is that you are hitting your device's "Max Vertex Attributes" limit. WebGL typically only supports 16 attributes. This .glb file is requesting 77! See all the in vec* lines in the dumped shader file. The one that triggered the error (a_targetPosition_11) is the 17th attribute in the list.

brunokunace commented 1 year ago

hi @jjhembd thanks for you reply, i'll post the screenshot bellow.

this glb its a result of https://readyplayer.me/ website. I use this same glb in threejs application, Autodesk Viewer (aka Forge), Matterport, Ifc.js library, but idk if cesium use threejs under the hood.

If work in threejs, need to work here too right? but all uses the same webgl engine

brunokunace commented 1 year ago
image
jjhembd commented 1 year ago

Thanks for the update @brunokunace. I'm still looking at this, but for reference, here is a codepen confirming what you said: threejs loads the GLB with no complaints.

ggetz commented 1 year ago

Thanks all. If the root of the issue is the number of morph targets supported, I think this is a duplicate with https://github.com/CesiumGS/cesium/issues/10810. Please feel free re-open if I misinterpreted anything.