jit.gl.sketch and CPU consumption
Hi Jitter's
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 ?
Currently, my rendering options are :
jit.gl.render: @auto_material 0 @depth_enable 0 @two_sided 0 @blend_enable 1
jit.gl.sketch: @auto_material 0 @depth_enable 0 @two_sided 0 @pushstate 0 @blend_enable 1
Any idea is welcome...
Thank's
Hi vanille béchamel,
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% !!!
Cheers
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)
best
pieter
Hi Pieter,
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.
Cheers
BenCello
Hi BenCello,
indeed the gllinewidth does exactly that, unlike the line_width message.
Now up to the anti-aliasing
thx
pieter