[sharing] Triplehead2go rendering setup (updated for Max6 and jit.gl.node)

dtr's icon

Now that the shared context problems are resolved in Max6.0.4 I updated my Triplehead2go rendering setup (original: https://cycling74.com/forums/sharing-is-bladibla-render-multiple-views-of-1-gl-scene-for-triplehead-setup). It renders 3 rotated views of the scene and maps them on the 3 outputs (3x800x600). It now works with jit.gl.node which makes it quite a bit cleaner. It includes a preview window using shared contexts on GPU for performance.

Question 1: although sync is set to 0 on the windows I need to manually resend 'sync 0' after the patch has loaded for it to take effect. Any ideas why?
I need it because my preview monitor runs at 60hz while my triplehead beamers run at up to 85hz. With sync on Jitter locks to the 60hz monitor.

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

Question 2: is there a more efficient way of doing this than rendering the scene as 3 separate meshes, one for each view?

Wetterberg's icon

q2: there (edit: may be) no need to repeat the rendering, when you can use jit.gl.camera to have multiple views. It can definitely do different viewports, but can it do multiple rotations, for instance?

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

this patch by robert ramirez shows a simple version of it - look out for the @viewport attribute:

dtr's icon

tanx for the tip! i was totally oblivious to the existence of that object... will work out whether it's applicable to this case.

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

and here's the jit.gl.camera version. uses 3 camera's instead of 3 meshes. renders each view to texture and videoplane separately for slab processing. pretty nice and clean. i like.

dtr's icon

now that i think of it, it probably could do with one view node instead of 3. it can contain the 3 videoplanes. gonna try that.

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

yup, that works. i don't think it gets any simpler than this. great stuff this node object.

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

now with keystone correction / projection mapping using jit.gl.cornerpin on each of the 3 outputs.

Jesse's icon

Nice work. As far as I can tell the videoplanes are now extraneous - once you use jit.gl.cornerpin you lose all of the translation and rotation possibilities.

dtr's icon

you're right, tanx.

i thought the videoplanes were grabbing the cornerpin outputs but they aren't. can be removed from the patch and it will still function.

now i need to come up with something to clip the 3 cornerpin outputs to the 800x600 size of each triplehead output. i don't want them to overlap or bleed into each other. thought the videoplanes were doing that.

strimbob's icon

sorry to dig up an old thread, just what to say thanks a bunch, this patch is great!!!

dtr's icon

you're welcome :)

j-Ambroise Vesac's icon

Super exemple!

What's happening with the light in this configuration? Each camera seams to get it's own shadows/light angle.

4225.tripleheadmodel.maxpat
Max Patch
dtr's icon

not sure about what's happening there, haven't been using lighting in my projects

yagodequay's icon

Holy space balls this is great!

yagodequay's icon

@dtr your model is configured for 3 walls joined consecutively on the horizontal axis. What if I wanted to use this in the corner of a cube like this: http://l.rgbimg.com/cache1nSkH8/users/l/li/littleman/600/ml6lNgW.jpg

@j-Ambroise Vesac were you able to fix the shading of a 3D object?

dtr's icon

You'll have to play with each camera's position, rotation and look_at parameters to get the view perspectives you need.

dtr's icon

Wait a sec... Do you mean one beamer projecting into that corner? Then you'd make the output window the size of your beamer resolution and play with the cornerpins (or videoplanes) to map your surfaces.