fand / veda

⚡VJ / Live Coding on Atom⚡
http://veda.gl/
MIT License
509 stars 34 forks source link

Can't declare an array #242

Closed myxyy closed 4 years ago

myxyy commented 4 years ago

I want to use array declaration like:

float array[3] = float[3](1.0,0.0,1.0);

but I get an error message:

'arrayed constructor' : not supported for this version or the enabled extensions

Do I need some extensions or is there an alternative way to use an array-like structure?

fand commented 4 years ago

Hi @myxyy ! Unfortunately VEDA doesn't support constant arrays because it runs on WebGL 1, which only supports GLSL ES 2.0. However, you can use vec3 instead of float arrays like: vec3 array = (1.0, 0.0, 1.0);.

myxyy commented 4 years ago

Thanks, I understand. Practically, I want to use more longer array, of size 8 or 16, for sound shaders.