mojomatosis

Monkey Archive Forums/Monkey Apps/mojomatosis

Grant(Posted 2013) [#1]
mojomatosis discussion thread. Please leave your feedback here.


zoqfotpik(Posted 2014) [#2]
This is amazing, particularly the image extrusion.


Danilo(Posted 2014) [#3]
My favorite playable demo in Apps section!


Halfdan(Posted 2014) [#4]
Very cool! My favorite demo as well

Good performance as well, do you use a canvas wrapper or something? my HTML5 drawing is very slow with with SetColor/DrawPoint..


Grant(Posted 2014) [#5]
Hi Halfdan,

I'm not doing anything fancy with drawing, just obeying some simple rules after a great deal of experimenting on a crap laptop :)
Some simple html5 drawing info and tips for you my friend :)

If you plan to draw lots of things like points and rectangles, then changing colour all the time will cause a slight performance hit on the canvas, points are generally slow at the best of times because there's so much to fill. You have to make large amounts of calls to drawing functions which from what I can see, are immediate in nature.
I treat rectangles like big pixels: on the html5 target, you should try to always draw your rectangles aligned to pixels. The reason for this is quite simple, it stops the browser smoothing the edges and so uses less of the available graphics horsepower, meaning you can draw more! you just have to be careful. drawing lines can also be a bit of a performance hit on the weaker chips because they get anti-aliased.
When drawing image rectangles, try to avoid scaling, rotation and changing the diffuse colour of images, always draw images pixel aligned.
ie: never draw any images at things like 112.567, 129.762 ... or filtering will kick in and this effects performance.
At the end of the day the html5 target presents a bit of a challenge, it suffers hugely inconsistent performance because of the sheer variety of hardware and browsers you expect it to work on. However it can be a hell of a lot of fun because of these limitations you have to work around.