Looking for help: error message "uniformMap[mu.name] is not a function"

Hi there. I am trying to add a water area w/ reflection effects in Cesium using vertex shader code copied from three.js. The code is shown below. And this error in title keeps showing up even though I declared all the uniforms in material.fabric.uniforms.
I googled it but there aren’t much information about this.
Forgive me if it’s a stupid question. I’m just new to Cesium.js :rofl:
Sandcastle Share

Hi! Did you find the reason of error?

I’m playing with materials and shaders too, and have got the same problem:
TypeError: uniformMap[mu.name] is not a function
> at ShaderProgram._setUniforms (https://sandcastle.cesium.com/CesiumUnminified/Cesium.js:104114:39)

I’ve checked the file https://sandcastle.cesium.com/CesiumUnminified/Cesium.js:104114 and there is the next code:

ShaderProgram.prototype._setUniforms = function (
    uniformMap,
    uniformState,
    validate
      ) {
        var len;
        var i;

        if (defined(uniformMap)) {
          var manualUniforms = this._manualUniforms;
          len = manualUniforms.length;
          for (i = 0; i < len; ++i) {
            var mu = manualUniforms[i];
            mu.value = uniformMap[mu.name]();
          }
        }
        ...

Error at the line: mu.value = uniformMap[mu.name]();

But, unfortunately, it doesn’t help me to understand, how can I fix the issue on my side. :confused:

It’s because the uniform used in shaders are not defined (the right way).
In my case, I use appearance.uniforms.alpha = 1.0; to make things work.

Are you using the original sandcastle example, or an updated version where the tons of errors in the code are fixed? Or have you got a new one we can look at?

Cheers,

Alex

Hi Alex,

Thanks for your answer.
This is my own sandcastle example.

I need to solve the task of colorizing polygon like the global ElevationRamp. So, I’m playing with custom fabric / appearance / shaders. But, as I’m new in it, I’m getting a lot of errors and trying to understand, how everything works here. And, I’m sure, that I’m doing smth wrong and will be happy, if you can help me a little.

Cheers,
Olga.

Hi,

Thanks for your answer.
It’s good, that you solved your issue. :slightly_smiling_face:

i meet the same error,but i am confused about how to use appearance.uniforms.alpha = 1.0.can you show me your modified sandcastle example? thanks a lot.

I also encountered the same problem when writing river shaders. Can you help me take a look? There is my example.

tReflectionMap 是默认的吗?没看到有相关的纹理数据