Skip to content

THREE.WebGLProgram: Shader Error 0 - VALIDATE_STATUS false #346

@chenjianan0823

Description

@chenjianan0823
    {
      "imports": {
        "three": "https://cdn.jsdelivr.net/npm/three@0.180.0/build/three.module.js",
        "@sparkjsdev/spark": "https://cdn.jsdelivr.net/npm/@sparkjsdev/spark@2.0.0/dist/spark.module.min.js"
      }
    }

I use Chrome browsers, and select the NVIDIA preferred graphics processor for them, but then I get the following error:

Material Name: 
Material Type: RawShaderMaterial

Program Info Log: Fragment shader is not compiled.


FRAGMENT

WARNING: 0:35: '/' : Divide by zero during constant folding
ERROR: 0:221: 'packed' : Illegal use of reserved word
ERROR: 0:221: 'packed' : syntax error

  216: 
  217: uvec4 packSplat(vec3 center, vec3 scales, vec4 quaternion, vec4 rgba) {
  218:     return packSplatEncoding(center, scales, quaternion, rgba, vec4(0.0, 1.0, LN_SCALE_MIN, LN_SCALE_MAX));
  219: }
  220: 
> 221: void unpackSplatEncoding(uvec4 packed, out vec3 center, out vec3 scales, out vec4 quaternion, out vec4 rgba, vec4 rgbMinMaxLnScaleMinMax) {
  222:     uint word0 = packed.x, word1 = packed.y, word2 = packed.z, word3 = packed.w;
  223: 
  224:     uvec4 uRgba = uvec4(word0 & 0xffu, (word0 >> 8u) & 0xffu, (word0 >> 16u) & 0xffu, (word0 >> 24u) & 0xffu);
  225:     float rgbMin = rgbMinMaxLnScaleMinMax.x;
  226:     float rgbMax = rgbMinMaxLnScaleMinMax.y;
  227:     rgba = (vec4(uRgba) / 255.0);

In addition, I tried the same method in Firefox browser, and there was no error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions