News for hackers. Stuff that matters.
Re:WebGL Water by petercooper on Wednesday February 19, 2014 @11:45AM (#7264476)
WebGL is essentially a specialized OpenGL-ES based context of canvas. HTML5 canvas in its usual context is only for 2D. You can render 3D on it but you'll essentially be creating your own software rendering engine from scratch.
Re:WebGL Water by rdtsc on Wednesday February 19, 2014 @12:23PM (#7264714)
So then my question is what is the future of WebGL?

I could see canvas extended to have 3D operations. Like say draw point takes 3 coordinates now. I can see a third party library that does 3D but projects it down to 2D and uses regular 2D commands on the canvas, or I see supporting WebGL interface and writing OpenGL style code.

Re:WebGL Water by _greim_ on Wednesday February 19, 2014 @01:35PM (#7265237)
> I could see canvas extended to have 3D operations. Like say draw point takes 3 coordinates now.

I think that's the role WebGL essentially fulfills. It was just done in a way that uses OpenGL instead of reinventing the wheel, since a 3D rendering engine is a non-trivial thing to build. In other words, you can do either:

    var ctx = myCanvas.getContext('2d');
    // ctx has the 2d api

    var ctx = myCanvas.getContext('webgl');
    // ctx has the webgl 3d api
> I can see a third party library that does 3D but projects it down to 2D and uses regular 2D commands on the canvas.

I think it would be a lot slower. Either way there's a 3D rendering engine. Embedding the engine natively and having GPU speedups is a dominating factor.

> or I see supporting WebGL interface and writing OpenGL style code.

See first point above.

Re:WebGL Water by etherealG on Wednesday February 19, 2014 @01:05PM (#7265018)
I think the suggestions of using a lib to get higher level stuff are good ones. For simple enough stuff, d3, or more complex whole game engines are available.
Re:WebGL Water by gmac on Thursday February 20, 2014 @05:10AM (#7269985)
http://threejs.org/ may be relevant.