shader-web-background icon indicating copy to clipboard operation
shader-web-background copied to clipboard

Array uniforms?

Open nedtwigg opened this issue 1 year ago • 0 comments

My shader has:

uniform vec2 iThingsPos[8];

And in the js I do:

    shaderWebBackground.shade({
      canvas: ref.current!,
      shaders: {
        image: {
          uniforms: {
            iThingsPos: (gl, loc, ctx) => gl.uniform2fv(loc, new Float32(...))
          },
        },
      },
    });

I'm getting this runtime error

shaderWebBackground.ConfigError: No configuration for uniform "iThingsPos[0]" defined in shader "image"

Is there a trick for passing array uniforms with this library?

Thanks for open sourcing this btw, great little library!

nedtwigg avatar Mar 01 '24 23:03 nedtwigg