I'm trying to change my HTML5 2d platformer game to use WebGL rendering.
Link to my game: http://yle.fi/galaxi/mazq/2014/katko_dev/ (no WebGL implementation yet)
It currently renders to a canvas element with single "context.putImageData(imgData, 0, 0)" call, but it is slow with firefox and becomes a bottleneck with large resolutions on other browsers too.
I have successfully used my Uint8ClampedArray RGBA as a texture for a "fullscreen" plane, but updating this texture data by calling...
gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 512, 512, 0, gl.RGBA, gl.UNSIGNED_BYTE, texture_data);
...at 50fps seems too slow at least for firefox.
-Is there some better way to update the texture?
-Is there some other way to display 2d Uint8ClampedArray RGBA - data with WebGL?
-Is it possible to somehow directly overwrite the color buffer?