Forums > Jitter

Open Gl Preview Window

September 19, 2010 | 9:09 pm


I’ve tried to figure out how to set up a preview window in Open Gl Context.
I wanna use a gl.handle in a preview window so that the mouse isn’t visible in the main output window.
The examples which have been posted didn’t work for me also the jitter recipe 39.
I am running windows 7. Could this be a problem in this case?
Kind regards

September 19, 2010 | 9:43 pm

Preview windows can be pretty tricky..I had to come to the forum to get help with mine. Try posting an example patch of what you’ve got so far and we can probably help you the rest of the way.

September 20, 2010 | 12:48 pm

Hello Laserpilot

Thx for the reply. I recognized that you’ve started a similar post. The exmple given in your thread didn’t work for me. The preview pwindow remained white. maybe i am missing something?
i’ve attached my patch. it’s messy and maybe some things don’t make senes or can be done better. i am relatively new to jitter so there are many things to learn and explore for me.
basicly i wanna process a camera image and after some processing put it on a videoplane to achieve some more different effects.
so my preview window is right now the end of the videoprocessing chain. but i wanna be able to get a real preview, after the end of the 3d objects chain… and i also wanna use the handle in this preview window so that i can take control from it to the main output window? or is something like auto rotate possible without the handle?

i am working within max for live. so maybe there have to be made some modifications – for exmaple with the audio input.

i didnn’t know how to paste my patch as text so i attached it

  1. gl_prev.maxpat
September 20, 2010 | 2:35 pm

Oof..that is quite an ugly patch..reminds me of my old days, but mine were worse :)

I got it working by cobbling together pieces from my patch

So here is what I did:

-Gave your gl.mesh a render name: finalrender

-Told gl.sketch to draw ‘finalrender’ (this is uneccessary i believe..but if you end up with multiple gl.mesh objects you can use this to draw them for you)

-added a second preview gl.render context that is shared with your original (see your render patcher) ..this captures the coloursexist as a texture and then puts it on it’s own videoplane

-created a pwindow which is named ‘coloursexistpreview’ (name it with the inspector)…it will latch onto a videoplane that is named the same but it requires no bangs for output, it just works

-changed the context of the gl.handle to now be ‘coloursexistpreview’ so now you can use your mouse on the preview window only

i think that’s it..took me about 5 minutes..less time than it took me initially, haha the future, to copy as select everything and then in the ‘edit’ menu select ‘copy compressed’ and it will copy everything to your clipboard

– Pasted Max Patch, click to expand. –
September 20, 2010 | 4:05 pm

thank you very much for your time!
sorry for the ugly patch. in fact the original is much uglier and it was allready a "cleaned" version.
i ve looked at it and it was the same as with the examples i’ve allready tried: the preview screen doesn’t show an image. are you on macintosh?
i have the suspect that these may be some windows issues? have tested it under win7 and xp and got the same problem.
at least i can now control the zoom and rotation from a seperate window!

what is the atribute capture for (gl sketch)? didn’t find it in the reference…

Have cleaned it up even further so that others could also have maybe a more pleasent look…

– Pasted Max Patch, click to expand. –
September 20, 2010 | 7:17 pm

hi, please check out the following basic example of creating an opengl preview window (as well as post-processing an opengl scene).

if this is not working for you, please provide all relevant computer specs (OS, GPU, max version).

if you have any questions about the technique, please ask:

– Pasted Max Patch, click to expand. –
September 20, 2010 | 7:48 pm

i’ve checked this example allready on two different computers. on both the preview pwindow remains white, after having pressed the dishes movie message and turned on the metro.
the max window says: Object ( ob3d_draw_end_texture:GL Error:Invalid Opreation
i am running windows 7 64 bit with 8gig ram, m4live 5.1.5 and a geforce gt 230.

September 20, 2010 | 8:20 pm

i will take a look on a windows machine when i get a chance.

September 24, 2010 | 6:33 am

i can reproduce this. thanks for the report.

in the meantime, you may be able to make it work by doing the following.
create an empty message box and put the following in it (without quotations but include the semi-colon).

"; jitter glreadback rtt"

September 27, 2010 | 9:32 pm

ok i don’t understand why but it works now!
many thanks for your help!!

September 28, 2010 | 12:43 am

In the next Max release, rtt mode will be default for Windows, as it already is for Mac.

In the meantime, we would love to get some feedback in regards to if this works for people’s patches/graphics cards/drivers.

In order to have Max start up with rtt mode as the default glreadback, create a text document with the following:

jitter glreadback rtt;

Title it ‘jitter-config.txt’ and save it somewhere in Max’s search path, though not in the ‘init’ folder. For example, I saved mine in Max 5.0/Cycling ’74/.

If you do experience any problems, please send an email to support at cycling 74 dot com, with your system specs and a simple patch with steps to reproduce. It may be that with older cards/drivers, ctt will perform better, but with most modern harddware rtt is probably the way to go for now.

Thanks for playing along!


September 30, 2010 | 6:25 pm

Hello again

I recognized that when i use a preview window in my render context and do some mesh transformation the edges get kind of distorted.
Also when you drag and resize the main render window with the mouse the preview window did react in a strange way.
Maybe i am using the gl handle in a wrong way?

Maybe i am doing something wrong with the rendering? For example i didn’t get what the gl.slab is about, which was used in the example…

In my patch i made two render contextes one with the other without the preview window. hit the metro for mesh transformation.
you can switch to fullscreen with "esc" or "1" respectivly to see the difference. the one without the preview window has smoother edges in my setup at least…

here is the patch

– Pasted Max Patch, click to expand. –
Viewing 12 posts - 1 through 12 (of 12 total)

Forums > Jitter