MGraphics vs. jit.gl.sketch

cocamon's icon

hi everyone,

i've started doing a bit of work for my thesis using the jsui object. So far i've been using the sketch object, as i have done a little bit of work with OpenGl in the past. However, I'm aware that there is another set of possibilities involving the MGraphics system. I wanted to ask those of you who have had experience with both- is there any reason to choose Opengl over Mgraphics or vice versa? Is anyone combining these in their projects?

thank you kindly,

C

Rob Ramirez's icon

The current lay of the land:
jit.gl.sketch - sketch drawing commands executed on the GPU. fastest option but requires the output be a jit.gl context (or readback to matrix via jit.gl.asyncread)

jsui Sketch - sketch drawing commands executed on the GPU and the readback to CPU for display on repaint. slower than jit.gl.sketch

jsui Mgraphics - cairo graphics drawing commands executed on the CPU.

whether you use sketch or mgraphics generally comes down to drawing api preference i think.

cocamon's icon

thanks, Rob. i didn't even realize that there could be a difference between jit.gl.sketch and jsui Sketch. Guess i will be transitioning to the js object and jit.gl.sketch very soon :)

OCH's icon

thanks @Rob for putting it so simple.clear and ,