elm-explorations / webgl

Functional rendering with WebGL in Elm
https://package.elm-lang.org/packages/elm-explorations/webgl/latest/
BSD 3-Clause "New" or "Revised" License
116 stars 17 forks source link

Use gl.drawArrays for non-indexed meshes #16

Closed ianmackenzie closed 5 years ago

ianmackenzie commented 5 years ago

Currently, the code in WebGL.js uses gl.drawElements to draw all entities, constructing a 'dummy' index buffer for non-indexed meshes (which are in fact all current meshes except for those constructed using WebGL.indexedTriangles).

It would be better to use gl.drawArrays instead for non-indexed meshes; this would have a few advantages: