Passing an array of vec2 to shader in THREE.js
I've been searching the web for a while now and did not find the correct answer yet. I found the list of uniform types THREE.js uses, and I think the following code should be correct. At the last line I define an uniform array of Vector2. uniforms: { "center": { type: "v2", value: new THREE.Vector2( 0.5, 0.5 ) }, "aspectRatio": { type: "f", value: null }, "radius": { type: "f", value: 0.1 }, "pointList": { type: "v2v", value: [] }, }, In my js script I pass this array as follows. This should work too, I guess: // Add effects effect = new THREE.ShaderPass( THREE.MetaBalls2D ); effect