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
117 stars 17 forks source link

Performance improvements #28

Closed w0rm closed 4 years ago

w0rm commented 4 years ago

Closes #23 and #26

This PR improves webgl performance by reducing the number of gl calls. For more information click here

Most of this was done together with @ianmackenzie. He also set up a test scene using the soon-to-be-released elm-3d-scene package, that we used to benchmark the performance:

Screenshot 2020-06-26 at 21 53 38

@MartinSStewart, who had opened the original issue, provided the source code of his game. Here you can see that it got slightly better:

Screenshot 2020-06-25 at 21 45 06

Here you can see the absence of redundant calls:

Screenshot 2020-06-25 at 21 56 14

There were a lot of bugs, because of the stateful nature of webgl. In order to ensure that it works, I tested it using the following projects: