Switch or crossfade between two different OpenGL renderings

Jan 28, 2013 at 10:51pm

Switch or crossfade between two different OpenGL renderings

Sorry for the newbie question – this feels like it should be really simple, but I cannot for the life of me figure out how to do it! I want to be able to switch or crossfade between two different OpenGL renderings into the same window. I suppose I could render them both to a matrix and switch/crossfade those, but that’s CPU inefficient. Perhaps there is a way to do it with slabs or textures?

#66265
Jan 28, 2013 at 10:58pm

take a look at jit.gl.node. this is one of the things it was built for.
you will want to enable the @capture attribute, and you can xfade using slabs, or better yet, jit.gl.pix.

– Pasted Max Patch, click to expand. –
#238512
Jan 29, 2013 at 6:03am

Thank you! Unfortunately I’m still using Max 5! I wonder if there’s some workaround…

#238513
Jan 29, 2013 at 7:36pm

you can do this in max 5 using the to_texture message to jit.gl.render.
search the forum for this message, and i’m sure you’ll find some examples.

#238514
Jan 31, 2013 at 12:42am

Thanks again! I didn’t find a way to do it using to_texture, at least not one that I could understand or get to work, but I did find a post showing how to switch between scenes using the @capture attribute of jit.gl.sketch. One point I had been missing was setting @automatic 0 on gl objects, otherwise they tend to get automatically drawn in the wrong place.

Not sure if this is the best way of doing things but it seems to work pretty well. Patch posted for future reference:

– Pasted Max Patch, click to expand. –
#238515

You must be logged in to reply to this topic.