Copy_texture and Max 6

tom w's icon

Hi all

Max Patch
Copy patch and select New From Clipboard in Max.

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?

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

Cheers

Tom

Rob Ramirez's icon
Max Patch
Copy patch and select New From Clipboard in Max.

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

tom w's icon

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

Rob Ramirez's icon

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.

tom w's icon

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