mgraphics vs. canvas

Sep 12, 2012 at 9:35pm

mgraphics vs. canvas

i’m curious as to whether or not one of these will be supported for longer than the other, and also wondering why it would be advantageous to use either of them… i realize that canvas code is portable, but i’m still curious why the option exists. is it that people are looking for a more “native” mgraphics rendering engine that would be faster?

thx
jml

#64348
Sep 13, 2012 at 12:08pm

I’ve done a whole pile of UI stuff using the Sketch API, and I think I bypassed Canvas altogether. (There’s nothing about it in Max Help.) I’m using MGraphics at the moment, because it’s new and shiny (I’d like higher performance than Sketch) but am really waiting for better documentation.

#232082
Sep 13, 2012 at 4:28pm

i agree with nick regarding documentation.

i have been using mgraphics exclusively since max6 release and it is mainly fantastic. plenty experimentation required though.

the thing about canvas in max6 is that it is really there as a convenience right now, as in max6 it is just a compatibility layer between canvas syntax and mgraphics. you can see this by looking at the file
/Max6/Cycling ’74/jsextensions/CanvasExtension.js

i expect (‘my guess is’) that it is there now as eventually canvas will be more fully integrated into max. anyway for now, canvas will be significantly slower than a native implementation, and slower than mgraphics.

ej says (i seem to remember) that his ej.function object got a 250 % speed increase porting from sketch to mgraphics – that is significant. there are still a few things in sketch though that are useful. i am no expert though, just a tinkerer.

my personal huge wish / feature request is that one day cycling74 do away with compatability layers and get rid of jweb and fully port/integrate the entire webkit into max. i think this would be very powerful and very useful.

2cents.

#232083
Sep 21, 2012 at 11:31pm

thanks guys. for the time being, i think i might stick with mgraphics as well, but my intuition is to use canvas (the same type of intuition that led me to use js/jsui in the first place), as i kill multiple birds with one graphic stone.

#232084
Sep 22, 2012 at 9:49pm

Darwin’s November Patch-a-day examples cover a lot of MGraphics ground: http://cycling74.com/2011/11/11/november-patch-a-day/

#232085
Sep 23, 2012 at 1:35am

yeah; saw that. i’ve been following it…
thanks nick!

there’s (currently) not a lot of that sort of coverage on max canvas.
i’m converting some canvas code atm… it’ll work out. i’m going to give up on it for the time being and come back if it gets more love.
didn’t see a way to notify jsui of patching vs. pres mode, for ex.

jml

#232086

You must be logged in to reply to this topic.