Slow frame rate with GL Quad Structure

kamend's picture

Hey guys, first of all let me say that the community rocks and thanks for Kineme for the great free patches and plug-ins!

I am all new to using Quartz Composer, usually for all my installations, I use Openframeworks or Processing! I am trying to do something really basic to use inside Resolume Arena, for a recent video mapping, it's just a grid of quads with some basic animations, but for some reason the frame rate and the processor usage are super high and I can not understand, if I am doing something wrong or it's just Quartz Composer normal behavior. I am generating a quad structure with JavaScript, feeding it into a GL Quad Structure and just adding some interpolation of the color, frame rate is around 15-20 fps.

Any idea how I could optimize this? Attachment is below.

Thanks, Kamen kamend.com

PreviewAttachmentSize
Geoemtry JS.qtz7.38 KB

cybero's picture
Re: Slow frame rate with GL Quad Structure

The only way I could get close to that sort of 15 fps slow frame rate was to pump up the x and y iteration count.

kamend's picture
Re: Slow frame rate with GL Quad Structure

Yes, I forgot to mention that I am using 20x20 grid size. I tried using Mesh Creator, even OpenCL, but I guess redrawing on every frame is slow in Quartz.

Any ideas, how to speed that up? I guess writing my own plug-in is an option.

gtoledo3's picture
Re: Slow frame rate with GL Quad Structure

This is running at 60fps here... a macbook pro that's a couple years old.

Optimization will revolve around what your use case actually is. If the vertices aren't moving, and it's just the color that's interpolating, it might be better to leave the vertex stuff static, and manipulate the color change via the default color port, or by wrapping it in a GLSL shader that manipulates the color, overall.

The GL Quad Structure will probably be updating it's vertices each frame with a setup like this. There may be some kind of optimization going on that makes that not the case, but I'm thinking that's what's likeliest to happen. I don't think that would cause a big processing hit, but it's somewhere to look if your computer is really tapped out.

If you were doing your own plugin, maybe you could think about just referencing a vertex array that makes this shape, and using an input structure for the spacing. It might be faster.

If you're actually feeding textures and stuff, probably try to manage the textures so that they're the same resolution as the screenspace they're actually rendering to, and not larger than they have to be.