HTML5 and WebGL hybrid mode target

Monkey Forums/Monkey Programming/HTML5 and WebGL hybrid mode target

Canardian(Posted 2011) [#1]
I'm working on a new target for Monkey called WEBGL.

First it will feature only a few WebGL commands as Monkey commands, but important ones, which will do the same thing as HTML5 but much faster.

I managed to get an interesting hybrid mode working, so that you can use all the existing Monkey commands in HTML5 mode and some new WebGL Monkey commands on top of those.

Here's a first screenshot, the red lines are normal DrawLine commands in Monkey, and the white polygons are WebGL:


For this I had to add a new command to MonkeyTools also, called ClsTransparent, which works like the normal Cls command, but it clears the background transparent, so that everything under the GameCanvas shows WebGL content where no HTML5 2D objects are. I haven't tried yet to get the WebGL canvas also transparent, but perhaps that is also possible.

My Monkey target list looks now like this:



Mahan(Posted 2011) [#2]
This is insanely cool man!

Will your new target expose WebGL low level calls in the monkey language?

I'm thinking like in "MiniB3D for monkey" and with a web target. It would rock the future :)


Canardian(Posted 2011) [#3]
Yes, theoretically all WebGL commands can be exposed as Monkey commands, it's just a matter of writing lots of code :)

There's also a guy called Noobody who is working on Monkey3D, which is a full 3D WebGL module for Monkey. I have no clue about linear algebra, so I leave the 3D matrix math stuff and stencil shadows to him. My goal is only to make a faster HTML5 and Flash target.

I think when I have the first WEBGL version ready and published, the Monkey community can help to add more commands, as they follow all the same pattern.


Xaron(Posted 2011) [#4]
Awesome! Could you provide the results in our German Monkey coder community as well? I really appreciate your efforts! :)


Canardian(Posted 2011) [#5]
You mean the same thing in german? :)
Yeah I can do that.


Brucey(Posted 2011) [#6]
it's just a matter of writing lots of code

Haw haw... I hope you can type fast ! :-p