Copy_texture and Max 6

May 3, 2013 at 2:20pm

Copy_texture and Max 6

Hi all

I’m converting an old project from Max 5 to Max 6, and one of the things I’m struggling with is how to recreate the OpenGL preview features I used in that project. I used to use @shared_context and @copy_texture to copy the full OpenGL buffer from one context to another for a preview window: this worked fine in Max 5, but doesn’t in Max 6. I’m aware of the new ‘shared’ attribute of OpenGL contexts, and have substituted these for the old ‘@shared_context’ method, but can’t get the following to work. Could anybody shed some light on this please?

– Pasted Max Patch, click to expand. –

I’m running Max 6.1.2 on a Macbook Pro Retina 15″, OS Mountain Lion.

Cheers

Tom

#68075
May 3, 2013 at 6:13pm

if you’re just sharing textures, there’s no need to do anything other than enable shared on the windows or pwindows.

– Pasted Max Patch, click to expand. –
#244551
May 3, 2013 at 7:03pm

Thanks Rob for your reply.

However, I think I’ve made the example patch too simple to adequately demonstrate what I’m doing in the main project: what I need to do is capture the entire render buffer of one context and use it as a texture in another context: in the example posted I only had one videoplane in the OpenGL scene, but in the real thing I might have dozens of models, multiple video planes, jit.gl.multiples etc.

The Max5 trick of ‘copytotexture’ for a jit.gl.render worked brilliantly, and it is still documented in Max6, so I’m not sure what I’m missing to make it work in Max6.

Cheers

Tom

#244552
May 3, 2013 at 7:38pm

use jit.gl.node.
set the drawing context of all your objects to a named jit.gl.node and set @capture 1.
share that texture output with your preview context and your main context.

search the forum for more examples.

#244553
May 4, 2013 at 11:38am

Thanks Rob. That looks like it will do the trick – I’ll do some investigating.

I’m still curious as to what’s happened to the copytotexture technique, as the documentation doesn’t seem to have changed. But at least I can continue converting my project in the meantime

Tom

#244554

You must be logged in to reply to this topic.