Specific problem blending two separate 360-degree video sources

rbedgar@stanford.edu's icon

I have two 360° videos, each played by its own jit.movie~, feeding through a jit.gl.texture and a zoom-processing jit.gl.pix stage into its own jit.gl.material, which is applied (via @material) to its own jit.gl.mesh sphere. Each sphere has its own jit.gl.camera at its center, with pan/zoom controlled via UI.

Each camera has @capture 1 set, and its captured output is patch-corded directly into a jit.gl.layer — layer 1 for camera A, layer 2 for camera B — both inside one shared jit.world, all objects living in the same top-level patcher (I think GL objects need true top-level placement to bind reliably at all, not nested in a bpatcher or subpatcher).

Camera, mesh, and material aren't bound to any named context. I've tried wrapping each camera+mesh+material trio in its own jit.gl.node (with and without an explicit @name, with and without wiring the trio to the node's middle outlet) to try to keep the two trios isolated from each other — none of these variations fixed the actual problem.

The problem: rather than each camera independently viewing its own sphere, both cameras end up viewing the same sphere (source A). Changing source A's pan/zoom controls affects what's visible through both jit.gl.layers, and source B's video is never shown, even though its jit.movie~ is confirmed loaded and playing (its audio is audible). Blend-fading between the two layers (via blend_enable + alphablend) works correctly as a crossfade, but since both layers show the same sphere, it's just fading between two views of the same video.

Any thoughts on why two independently-instantiated camera+mesh+material groups would end up sharing the same gemoetry instead of staying isolated — whether left unbound or grouped via jit.gl.node? Is there a more reliable mechanism for this (separate jit.gl.render per group? something else?) — or is there a known gotcha with multiple jit.gl.nodes/ cameras coexisting in one context that I'm unaware of?

Any help is deeply appreciated.

Best

Robert

TFL's icon

Hard to tell what the real problem is without being able to see the patch, especially when there is some implicit context guessing involved.

From my understand, what you want to achieve is quite straightforward with [jit.gl.node]:

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

Rob Ramirez's icon

if implicit context binding, or patchcord context binding is not working for you then you can always use explicit context binding by providing your jit.gl objects the name of a jit.world or jit.gl.node to bind to as it's first argument (or as it's drawto attribute, which is effectively the same thing).

use the name attribute of both jit.world and jit.gl.node to explicitly name those contexts.

rbedgar@stanford.edu's icon

Thank you so much, TFL and Rob! Working with the jit.gl.node object was new to me, and I had my setup wrong. The dual-video file loading and blending is working now. Thanks again, this is a huge help with something I've put hours into trying to get right. Best, Robert.