opengl context share

Robin Price's icon

I'm having trouble with processing textures through slabs that have been rendered using a shared context. The actual patch I need to do this in is hideously large and complex but I posted a stripped down version a while ago but I fear it might have been a bit too hard to understand to get any help.

I've made an even more stripped down version that illustrates my problem. In the real patch I use my rutt etra patch and try to key on top of that a blurred image of a separately rendered data visualization rendered in a context that is shared with the rutt.

In the below patch this is simulated simply with a single texture read in from a movie standing in for the rutt and a spinning blurred torus standing in for the visualization. What I want is to be able to mix together the two textures without reading them off the gfx card and back on again.

In case you're wondering why I need to seperate render contexts it's because they need different lighting and effects and framerate.

With the below patch I've had some very strange results, such as feedback and mirroring, the second input to the normal slab is clearly not what the pmatrix displays.

Can anyone help ??

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

Robin Price's icon
Rob Ramirez's icon

just add "@shared_context two" to your gl.render one, and connect the gl.slab one to the slab mixer. you can't mix contexts for slab inputs.

MJ's icon

had a lot of shared context troubles too for a project i did last month

first you make a texture in 'two' this one you use/share in "one" and this one you're feeding it back to "two" via the cf.gaussian.2p slab

then you also need to tell the 'jit.gl.render one' to "share_context two"

this seems to work here

Robin Price's icon

@rob the rich, cheers for the advice but adding @shared_content two to the first renderer doesn't work, the output from the slab one is still blank

@MJ cheers for the help but I'm not sure i follow you, can you post the changes you made to my example? plz

Rob Ramirez's icon

you're saying the following patch doesn't work as expected?

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

MJ's icon

the patch from rob is the same as the one thats works here

if you still have a blank texture then maybe you dont have enough vram....

what is your system/gpu?

here its macpro(2008) ati radeon 2600

Robin Price's icon

sorry it doesn't work here, could this be a difference in gfx card's opengl implentation thing ??

after staring at what mj wrote this is how i got this to work and it seems to work for my more complicated patch too, i think ....

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

Robin Price's icon

confusing, not sure whether to worry about it or not, shouldn't be a vram issue as i got it to work albeit a different way. my lappy is a p4 1.8 single core, radeon mobility x700 128 mb ram.

i hate confusing stuff like this in jitter, if it worked for you why doesn't it work here, it just makes me uncomfortable when there is voodoo involved in getting a patch to work, i'll try your patch on my desktop quad core with big gfx card tommoz.

cheers for both ur inputs

Robin Price's icon

Though the patch I posted here works, the changes I make to my big patch to try and follow it's logic don't. They work when i alter the patch but when I save and reopen it they stop working. I'm not convinced their isn't some kind of bug with shared_context since the jitter recipe for previews doesn't work on my laptop, i had to ammend it since i have no video input but the preview pwindow is just white. can anyone else confirm this patch works ?

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

Robin Price's icon

The above patch doesn't work on my pc desktop either, can someone with a mac test this?

Robin Price's icon

my mac buddy confirms the patch works for him, so is this a windows bug? wes can you explain this ?

Antoine Villeret's icon

hi,

the patch doesn't work on my desktop PC with Nvidia G8600 GT (latest driver) and Max 5.0.7...

a.

Robin Price's icon

cheers i think i might send a bug report about this since the patch is basically the same as the jiter recipe it should work. i found a post where wes explained something about how the windows gl shared context was different and could give white textures like this but I didn't understand it.

Rob Ramirez's icon

bug # 2 of yours confirmed.

thanks for the report, we're working on it.

-rob

Robin Price's icon

tx rob, one more thing i wouldn't mind drawing your attention to while i'm reporting bugs