顶点颜色器按ec法线偏移会影响纹理坐标都变成0

    const vs = `
      precision highp float;
      attribute vec3 position3DHigh;
      attribute vec3 position3DLow;
      attribute float batchId;
      attribute vec4 position;
      attribute vec3 normal;
      attribute vec2 st;
      varying vec2 v_st;
      void main() {
          v_st = st;
          vec4 pos_ec = czm_translateRelativeToEye(position3DHigh, position3DLow);
          vec3 normal_wc = normalize(mat3(czm_model) * normal);
          vec4 normal_ec = normalize(mat4(czm_inverseView) * vec4(normal_wc,1.));
          // pos_ec.xyz += normal_ec.xyz * 0.; //这样st好像都变成0,为什么
          pos_ec.xyz += vec3(0.); //这样st正常
          gl_Position = czm_modelViewProjectionRelativeToEye * pos_ec; //投影变换
      }
    `;
    const fs = `      
      varying vec2 v_st;
      void main()
      {
            gl_FragColor = vec4(v_st,0.,1.);
      }      
    `;

// pos_ec.xyz += normal_ec.xyz * 0.; //这样st好像都变成0,请问为什么,谢谢

Hi @15811399626, I’m not finding that shader in our codebase. Can you please explain where this shader code came from, and what it is intended to do? That could help us understand your question.

code
我使用的cesium版本为1.95 您方便运行一下这段html吗,看看// pos_ec.xyz += offest; 这行代码,注释与不注释的区别

这个1.130.0的demo sandcastle demo 也不能正常偏移和显示纹理坐标,1,95时还可以偏移,但影像纹理坐标