I need to draw several thousands of colored arcs in a jitter window. Right now, I am using a the GL environment and a combination of a jit.gl.sketch and jit.gl.render to achieve this. I send all the vertices for each arc in GL format to the (same) jit.gl.sketch object.
However, with several thousands of arcs, it gets really heavy on the CPU (30% of CPU without, around 100% with, measure with "Activity Monitor" on my MBP).
I would really need to make this lighter. Do you see a way to achieve this?
Would it be more efficient to use one jit.gl.sketch per arc ? What about switching to jit.gl.mesh or using jit.gl.multiple? Would it be less heavy on the CPU ?
Thank’s for your reply.
I actually found another way to drastically reduce the CPU consumption of the drawing with enabling the "displaylist" option of jit.gl.sketch. As I understand it, it creates a cache of the elements to display. In my system I only add static arcs. So the cache seems very efficient.
I went down from about 100% to 12% !!!
Is there another way to minimize the load when drawing a few thousands of objects?
I’m writing a drawing program where spheres are drawn on a jit.gl.sketch.
I need to be able to change the viewpoint so I’m drawing spheres one next to another to draw a line, but it chokes really fast.
I can’t use the lineto command because I can’t control the individual width of each linesegment (I think)
I think the lineto drawing can be affected by a thickness (I don’t remember the command though). You may have a ligther way to draw your line if I’m right about that. Have look in the doc for OpenGL commands. Or even in the doc of OpenGL itself.