engine
engine copied to clipboard
WebAssembly Support
Would it be hard to use g3n engine with GoMobile?
https://github.com/golang/go/wiki/Mobile
I could not find a 3D engine for GoMobile. Maybe it could be a target for g3n as well?
Hi, I've ported g3n to gomobile on my own runtime (using dedicated plugin). Also on WebGL, here is a demo of what this great engine does on browsers (mouse wheel must be fixed) : http://tge-demo.thommil.com/
For the authors, as your engine is well written, you can target GLES3 (Android 5+, WebGL2), don't bother with older versions. Have a look at my OpenGL wrapper if you want here : https://github.com/thommil/tge-gl which can be easily integrated to your gls package. I can't propose a PR as my fork is based on plugin approach for my runtime.
gomobile must be forked to target GLES3 too and some optimisations must be made to avoid allocations in draw calls.
Don't hesitate to contact be if you want to port your engine to Mobile&Web.
That's awesome! We definitely want to target web and mobile! @leonsal and I will start working on targeting web using wasm first.
If it works in browser environment, it would be so awesome !!! For example, This engine can be used to render 3d graphic editor program like Figma used Webassembly for their web editor engine in browser much faster than webgl which is indirect api of opengl (GLSL) that is why webgl has performance lack compared to native opengl binding. So, I am excited to use this engine soon for the better web experience in 3D.
don't bother with older versions.
Maybe not right away, but it would be useful to have support for older versions too. There are a lot of Raspberry Pi's and similar hardware out in the wild... :smile:
@leonsal and I will start working on targeting web using wasm first.
Guess that's the new wasm branch? :smile:
https://github.com/g3n/engine/tree/wasm
For GLes2, I think that a soft emulation of VAO and few changes in shaders can do the job to avoid refactoring, branching and evolutions issues. I'm not sure but it's worth a try.
@udhos @NiNJAD3vel0per @justinclift @Thommil @amyadzuki Things are starting to work in the browser!
Also, here's a sneak peek of... something else that is in the works 😉 😄

Oh... play.g3n.rocks. That's a good concept. :smile:
Probably especially useful if it allows people to pull .obj files (etc) from online sources. Probably need to add a caching layer then, but that could come later. :smile:
There is a fantastic golang wasm CDN project with a playground.
https://github.com/dave/jsgo
Should help alot
TinyGo added a working garbage collector for wasm a few days ago, and a reasonable subset of Go seems to be functional now. eg 2D canvas stuff can be made to work:
https://justinclift.github.io/tinygo_canvas2/
That wasm driving that is only 45kB, uncompressed. When it's gz compressed (aka GitHub Pages, manually, or whatever), it's 19.55kB. eg 2-3% of the size of mainline Go wasm files.
This TinyGo thing has potential. :wink:
Mobile support is now being tracked by https://github.com/g3n/engine/issues/42. I'll re-title this thread to be about WebAssembly support since that's what has been mostly discussed here.
WebAssembly support is 90% in place, only missing asset loading and audio!
Hi there, Is there any new progress on this or plans ?
Hi @amine605 ! Dev is current paused as I don't have the bandwidth, but as mentioned, support it's almost done. IIRC you can comment audio imports and do some other minor changes and compilation to WASM should work. Pull requests welcome!
Hi! I'm a bit late to the party but this looks very interesting! I'm willing to play with g3n soon.