patriciogonzalezvivo / glslCanvas

Simple tool to load GLSL shaders on HTML Canvas using WebGL
http://patriciogonzalezvivo.github.io/glslCanvas/
MIT License
1.99k stars 183 forks source link

Is it possible to draw vertex data (i.e. gl.drawArrays)? #74

Open hrbigelow opened 3 years ago

hrbigelow commented 3 years ago

Hi,

Is it possible to draw vertices? For instance, with this [vertex shader]](https://github.com/hrbigelow/wij-wemnan/blob/master/shaders/scatter-v.cc), I eventually call it with:

write_to_gl: function() {
      this.gl.bindBuffer(this.gl.ARRAY_BUFFER, this.glbuf);
      this.gl.bufferData(this.gl.ARRAY_BUFFER, this.jsbuf, this.gl.STATIC_DRAW);
      this.gl.bindBuffer(this.gl.ARRAY_BUFFER, null);
}

But I don't see any part of glslCanvas API that allows sending vertex data to it, is there?

Thanks!