regl icon indicating copy to clipboard operation
regl copied to clipboard

Float Array Uniform cannot be used in version 2.1

Open Jo-Song opened this issue 2 years ago • 1 comments

Float Array Uniform was not available in version 2.1.0, but it works fine in version 1.4.2. I do not know why?

const drawTexture = regl({
  ...computeBase,

  frag: `
        precision mediump float;
      
        uniform sampler2D buffer;
        uniform float plasma[2];
        uniform float maxi;
        
        varying vec2 uv;
        
        void main() {

          gl_FragColor = vec4(plasma[0],plasma[1],1.0, 1.0);

        }`,

  uniforms: {
    buffer: regl.prop<any, "buffer">("buffer"),
    maxi: regl.prop<any, "maxi">("maxi"),
    "plasma[0]": 0.98,
    "plasma[1]": 0.99,
  },
});

Jo-Song avatar Dec 27 '21 11:12 Jo-Song

You might have to trace it back through a particular bug reproduction, but I believe this was reverted in https://github.com/regl-project/regl/pull/612 due to a bug reported in https://github.com/regl-project/regl/issues/611. I don't happen to know the particular cause, though I believe there was some ambiguity discussed in https://github.com/regl-project/regl/issues/258.

rreusser avatar Dec 29 '21 18:12 rreusser