Closed nacmartin closed 7 years ago
I just noticed rendering more complex meshes that the vertexes (not the indices) need to be reversed. Fixed in next commit.
@nacmartin it also looks that doBindSetup
and doBindSetupIndexed
are almost identical, maybe we can have one function that takes indices.
Another idea would be to add an Either
of each case, indexed and non-indexed. This will probably change the way of creating drawables, but this change is major anyway.
I've rebased this pull request, so we can continue discussing it here: https://github.com/elm-community/webgl/pull/8
This provides the ability to specify indices. There is a nice explanation of this technique here http://www.opengl-tutorial.org/intermediate-tutorials/tutorial-9-vbo-indexing/
Here is a gist that uses this feature: https://gist.github.com/nacmartin/fb79c2a0a0b26d9bd2c233f8f2da7564
Note that this is a change in the API. It doesn't break compatibility, as it only provides a new type for a union type, but I will understand if it is not merged.
This PR addresses #37