Re:MineCraftWebGL
by dmboyd on Sunday July 15, 2012 @10:27PM
(#4249036)
Last I looked, the vector math part of 3D wasn't handled by webGL, this uses Three.js to handle that, and looks to be the main bottleneck. Until you can do matrix/vector math using hardware, webGL is pretty much useless.
[ Parent
| on HN ]
> Until you can do matrix/vector math using hardware, webGL is pretty much useless.
Modern matrix libraries like glMatrix
https://github.com/toji/gl-matrix
use typed arrays effectively to do very fast matrix and vector math in JS. A modern JS engine can transform such code into something very efficient, more than fast enough to do things like even first person shooters.
Re:MineCraftWebGL
by DanielRibeiro on Sunday July 15, 2012 @10:41PM
(#4249062)
That is pretty much about right. I wrote a bit about the implementation[1], and the discussion went over how to optimize this (including, but not limited to, using shaders to do the drawing and not relying on Three.js so much).
[1] http://metaphysicaldeveloper.wordpress.com/2011/12/20/implem...
Would be interested if its worthwhile/possible using shaders as a wrapper for three.js. All I got when I was searching was there was a mozilla bug report and a hacked patch to expose SIMD through js[1], and a project to add SIMD support to vectors in Dart[2].
[1] https://bugzilla.mozilla.org/show_bug.cgi?id=644389
[2] http://www.altdevblogaday.com/2012/06/18/bringing-simd-accel...