Main Menu

Porting to GWT

Started by zammbi, March 20, 2012, 12:40:07 PM

Previous topic - Next topic

zammbi

I thought up an interesting idea which I would see to be popular is a port to GWT.
Though probably quite a bit of work but I thought I will put the idea out there just in case.

I was studying PlayN (http://code.google.com/p/playn/), and read that they were starting to support 3d. For those that don't know PlayN is built on top of GWT and allows you to compile your Java code into flash/objective C/WebGL/browser canvas/android/etc. It has some smooth examples of using the jBullet library. So I wondered if JPCT could do something similar to bring 3d to the web using WebGl.

I searched around and it seems there is a library (http://code.google.com/p/gwtgl/) for a near 1:1 mapping of the WebGL API for GWT.

Which the 3d engine (Ethereal Engine) is based on GWTGL: http://code.google.com/p/ethereal-engine/. Interesting to find that it seems to use some jMonkey classes.

Also found this low level library too: http://code.google.com/p/gwt-g3d/

So it seems possible you could port JPCT and use the GWTGL library. Not sure what the performance of GWT would be like but the basic demos run well in the above libraries. I have seen some impressive stuff with plain JavaScript and WebGL.

WebGL is based on OpenGL ES 2.0.
Browsers that currently support WebGL: Safari, Chrome, Firefox, Opera and Opera mini.
Looks like it does quite fine in mobile browsers too: http://www.ichemlabs.com/1375

EgonOlsen

I don't think that this would work with the current versions, because there aren't solely GL ES 2.0 based. The 1.1 render path has no counterpart in WebGL, so i would have to scratch that before it might even work. From what i tried so far, javascript performance (as much as it has improved over the years) still sucks compared to a Java VM, even Dalvik.

It might happen one day though...but not now.

zammbi

QuoteFrom what i tried so far, javascript performance (as much as it has improved over the years) still sucks compared to a Java VM, even Dalvik.
While that might be true. There is currently a huge race in the browser wars in getting the fastest JS. Most browsers have caught up to Chrome.
2 years ago Google showed off a Quake 2 port based on Jake2 using GWT which works well on Firefox, Safari and Chrome.
http://www.youtube.com/watch?v=fyfu4OwjUEI
http://code.google.com/p/quake2-gwt-port/

To me it shows its ready for some casual JPCT games :P

QuoteIt might happen one day though...but not now.
All good  8)