4 ms·
Nice, but it seems to busy wait: my CPU is pegged at 50% even when I am not doing anything.
by eta_carinae 14y ago
Nice, but it seems to busy wait: my CPU is pegged at 50% even when I am not doing anything.
- officemonkey 14y agoSo, just like Minecraft. :-D
- dmboyd 14y agoLast 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.
- DanielRibeiro 14y agoThat 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/implementing-minecraft-in-webgl/ http://metaphysicaldeveloper.wordpress.com/2011/12/20/implem...
- dmboyd 14y agoWould 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 https://bugzilla.mozilla.org/show_bug.cgi?id=644389 [2] http://www.altdevblogaday.com/2012/06/18/bringing-simd-accelerated-vector-math-to-the-web-through-dart/ http://www.altdevblogaday.com/2012/06/18/bringing-simd-accel...
- azakai 14y ago> 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 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.