Live data from Hacker News

MineCraftWebGL

danielribeiro.github.com

11–20 of 59 posts

Re: MineCraftWebGL

#11
post #5

Really nice looking impl in JS, though I'd add that doing perlin noise over a limited grid is a pretty limited subset of what Minecraft does. Minecraft's terrain generator does a couple of passes (last I read about this, things may have changed) that generates cave systems, the surface level topography, forests, etc. http://notch.tumblr.com/post/3746989361/terrain-generation-p... Still, definitely a cool project.

Yeah this is a very limited subset of what Minecraft does and arguably the implemented bits are the low hanging fruit. I wrote a "game" in my teens that covers this functionality, though in C++ not JS on a browser.

Re: MineCraftWebGL

#15

Nice, but it seems to busy wait: my CPU is pegged at 50% even when I am not doing anything.

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.

Re: MineCraftWebGL

#16
post #15

Nice, but it seems to busy wait: my CPU is pegged at 50% even when I am not doing anything.

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.

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...

Re: MineCraftWebGL

#17
post #15

Earlier quoted context omitted.

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.

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...

Re: MineCraftWebGL

#18
post #15

Nice, but it seems to busy wait: my CPU is pegged at 50% even when I am not doing anything.

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.

> 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

#20

It makes me sad when cool things like this don't support keyboard layouts other than QWERTY

Someone who goes out of their way to learn other keyboard layouts should probably go the extra step in having a way to map keys for stuff like this.
Post reply on HN