regl-project / regl

👑 Functional WebGL
https://regl-project.github.io/
MIT License
5.25k stars 324 forks source link

Alternatives to define array uniforms #258

Open milcktoast opened 8 years ago

milcktoast commented 8 years ago

The lighting example uses key names per item'lights[0]': light0. This could become pretty verbose and cumbersome, is it planned / possible to allow passing arrays instead lights: [light0, light1, ...]?

Erkaman commented 8 years ago

I think that syntax would greatly simplify things! Let us see what @mikolalysenko has to say.

mikolalysenko commented 8 years ago

I wanted to do this originally, but ran into the problem that it is ambiguous for vec or mat type uniforms. That said, I am still open to the idea and there are probably ways to do things better or simpler here if we can resolve the ambiguity.

rreusser commented 2 years ago

Reopening since I believe #591 introduced a bug raised in #611 and reverted in #612.