Preview window in OpenGL

May 7, 2010 at 5:48am

Preview window in OpenGL

So I’m trying to add a preview window to my massive video performance patch as per the instructions in Recipe 39 but I seem to be missing something, or maybe the recipe has a little more than what I need?

My chain goes video-> slab chain -> 4 bpatchers for corner-pinning that terminate in jit.gl.mesh’s (each bpatcher goes to a seperate layer)

I don’t have any gl.videoplanes in use like the recipe demonstrates, except for the one that I’m trying to use to send to a jit.pwindow..everything is coming from my gl.mesh’s

I guess I’m asking where I need to capture the texture from..do i need to add @capture sc_tex to my gl.mesh’s and leave a [jit.gl.texture @name sc_tex] in my master renderer, or would it be better to somehow capture the texture at the end of the slab chain and not worry about..I’ve tried a couple combinations with no success yet..

#50243
May 7, 2010 at 5:44pm

instead of explaining, i’ve created a patch that might be easier to understand than the recipe.
let me know if anything is still not clear:

– Pasted Max Patch, click to expand. –
#180313
May 7, 2010 at 7:41pm

Thanks, that got me a lot closer than I was getting last night. I’m now getting something in both windows. I ended up putting a videoplane at the end of my slab chain and before it gets split out into my 4 individual cornerpin meshes.

I tried adding @capture finalcap to the meshes (theyre the same patch repeated with ‘#1′ arguments to determine their layers) but only the top layer was represented in both windows. If i just stop it with a videoplane, my fullscreen window can still see the quad-warped meshes, but my preview just sees the fullframe video that comes at the end of the slabchain. Is there something else I could be doing, or would it just be easier to leave my preview window simple without capturing 4 seperate textures from the meshes?

One more question, what would be the best way to save FPS and turn the preview window off when I need to..where should I put my gates? I’m thinking before the gl.render preview and the gl.videoplane at the end of the slabchain. I just want to avoid unnecessary operations.

Thanks again

#180314
May 10, 2010 at 7:28pm

a gl.texture can only capture a single opengl object.
this is why in the jitter recipe, the capturing is done from a jit.gl.sketch.
you must name all your gl objects, and tell you sketch to draw them with the “drawobject” message, and set the @capture on your sketch.

you can toggle the preview context simply by putting a gate on your drawbang and erase messages to the preview jit.gl.render.

– Pasted Max Patch, click to expand. –
#180315
May 12, 2010 at 5:28am

Amazing..I can feel my gl powers growing! haha…I got it to work after messing with the drawobject gl.sketch order and double checking my blending modes and such. This is going to help a lot when I try to make that scenewarp patch into a slab chain effect…thanks for what you do for everyone here rob!

#180316

You must be logged in to reply to this topic.