This PR improves webgl performance by reducing the number of gl calls. For more information click here
the uniforms are diffed using === to avoid reuploading common scene parameters like camera matrix or lights
attribute locations are cached so that they don't have to be retrieved for every draw call
webgl rendering settings are diffed against the JavaScript snapshot
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:
@MartinSStewart, who had opened the original issue, provided the source code of his game. Here you can see that it got slightly better:
Here you can see the absence of redundant calls:
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:
Closes #23 and #26
This PR improves webgl performance by reducing the number of gl calls. For more information click here
===
to avoid reuploading common scene parameters like camera matrix or lightsMost 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:
@MartinSStewart, who had opened the original issue, provided the source code of his game. Here you can see that it got slightly better:
Here you can see the absence of redundant calls:
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: