WebGL Meincraft
dev.pocoo.org
dev.pocoo.org
When I have finished this it will perform better.
> Or is this 'demo' asking too much of WebGL?
The WebGL part is only half the story. It uses webworkers for the perlin noise generation and this is currently very slow in JavaScript.
Whether that's WebGL or the programming is something I don't know.
Well. There are a couple of reasons for this. First of all: yes, it should keep 4 CPUs busy. I spawn of four background workers so it pretty much hogs everything.
That said, not only the world generation is slow right now, also the VBO generation is because I do some very conservative invalidation which causes some VBOs to be generated multiple times.
I have a lot of stuff that I can do to make this faster and my local version already performs better but I caused some bugs in the coordinate system conversion and my frustum culling. I have to iron this out first before I update the live demo.
This version (rendering wise) on my Mac does actually render faster than Minecraft at equal rendering distances.
Everyone, and their dog, have been writing Minecraft-style world rendering demos for a few years now and there are also quite a few blog posts that describe the world generation algorithm. They're always an interesting read, but I would be more interested in how you get that stuff to the GPU and how do you render it.
Also some insights about WebGL limitations would be welcome. Would your task have been easier if you could memory map your vertex buffers or use instanced draw calls? This is the kind of stuff I'd love to hear about as a graphics programmer.
Also because web workers don't work great yet.
Yes it is. I have experimental frustum culling implemented but something with the coordinates is wrong and it starts to cull things it should not.
> But I can't understand why it's that slow ;(
Because it's work in progress and in many parts the implementation is just not finished yet. I need to fix the frustum culling, I have to improve the front to back rendering, have to switch to transferred objects for the web workers where possible, speed up the critical code paths and fix the Chrome performance bugs that come from too many VBO switches.
Give us some technical details of the project please.
Very CPU heavy. For those wondering, it does work, it just takes a while for anything to appear.