jit.gl.readback ; is it my patch or my harware that causes the problem.

    Jan 17 2017 | 1:54 am
    Hello. I’m trying to build a patch using jit,world and openGL. I need two jit.pwindow in which I can alternate between two videos and one jit.pwindow that shows the image captured from my laptop’s camera.
    I have made this patch that was working fine for a brief period of time. But then there is one jit.pwindow that has stops showing the videos and when I took a look at the Max Console, there was these messages that kept repeating continuously while jit.world was enable :
    jit.gl.fbo: framebuffer incomplete, missing draw buffer! jit.gl.fbo: error initializing capture jit.gl.readback: error entering FBO: GL Error: Invalid Framebuffer Operation jit.gl.videoplane: jit.gl.texture: error disabling texture unit: GL Error: Invalid Framebuffer Operation jit.gl.fbo: error unbinding fbo: GL Error: Stack underflow
    I have read a bit on the forum about OpenGL Readback, but I can’t figure out if what is causing the problem is the way I have build my patch or if it’s a hardware limitation that my computer has.
    Here are my computer’s specs :
    MacBook Air (11-inch, Early 2014) OS X Yosemite
    Processor : 1,7 GHz Intel Core i7 RAM : 8 Go 1600 MHz DDR3 GPU : Intel HD Graphics 5000 1536 Mo
    If someone has any clues, please let me know.

    • Jan 17 2017 | 7:00 pm
      hey Doug, looks like you totally misunderstanding something related to the rendering contexts, at this point things are much more easier with Max...
      if i didn't misunderstood, what you looking for can be done like this:
    • Jan 17 2017 | 10:50 pm
      You exactly understood what I was trying to achieve Carsol! And it works fine. You are also right about my misunderstanding of the rendering contexts. I'm having a hard time trying to grasp these notions with Jitter. I've went thru multiple tutorials and also read a lot around the forum about all the possible settings for optimizing. It's a really hard quest, I find.
      Thank you very much for your help. I really appreciate. Cheers.
    • Jan 18 2017 | 1:00 am
      the optimized way to do this is using shared contexts.
      set @shared 1 on your jit.world create a jit.pwindow @shared 1 @name pwinname create a jit.gl.render pwinname create a jit.gl.videoplane pwinname @transform_reset 2 update the pwin context using the bang out of jit.world
    • Jan 18 2017 | 3:15 am
      Rob, always good have you in a thread! can you explain please why setting 3 render contexts for this patch is the most optimized way?
      and why jit.world and the jit.pwindow's needs to be in shared=1 ? theres a resource shared between the contexts?
      Doug,,, looks like your misunderstanding almost leads you to found the optimized way for the patch!! X)))))
    • Jan 18 2017 | 3:49 am
      I really like the questions you are asking Carsol! I'm curious to see Rob's answer.
    • Jan 18 2017 | 5:30 pm
      because it keeps everything on the GPU. sending a gl-texture directly to the input of a jit.pwindow does a CPU readback to matrix, which is much slower than displaying the texture in a GL context.
      enabling shared allows textures from one context (the jit.world) to be displayed in another (the pwindows), and vice versa.
    • Jan 19 2017 | 6:20 pm
      Thanks a lot Rob for your explanations. Help to clear some things in my understanding.
    • Jan 19 2017 | 10:08 pm
      Hello again. I'm still working on the same patch I'm trying to build. I have used Rob's advice and patch he gave me earlier in this post to build my patch. Basically, I need 8 jit.pwindow in the same patch that I will then need to move around easily and eventually add some fpic object and some comment objects around them. I have made this patch which I have included here. I'm having difficulty to run the patch without rendering problems. Here's what happens :
      First, when I activate the jit.world toggle, I have these messages constantly showing in the Max console :
      jit.gl.context: no device for new gl context! warning: couldn't create context, trying without depthbuffer jit.gl.context: no device for new gl context! warning: couldn't create context, trying without double buffering
      Then, while jit.world is still rendering (even with the warning messages), I start the jit.grab object and all the jit.movie~ objects (numbered from 1 to 8 in my patch). From 1 to 5 , everything works. From 6 to 8, once started the jit.pwindows keeps black. If I then press " Command + E " to go into Edit mode, suddenly, all the jit.pwindow begins to render there movie. And I don't get anymore warnings in the Max console.
      I'm still trying to figure out, again, if I'm running into hardware limitation, maybe because there is a limit to how many rendering context I can create, or if there is something wrong in my patch.
      Thanks again for any kind of help.
    • Jan 20 2017 | 6:47 pm
      hi doug, i tried out your patch and was able to get everything drawing as expected. i don't see any major problems, so your issues are probably related to running out of hardware resources (cpu, memory, or gpu). are you running in 64 bit mode? you should be, in order to utilize all available system memory.
      unless you have a pretty hefty machine, playing back 8 videos at dims higher than the 320x240 of the test media is going to be tricky. but AFAICT, your patching is correct.
    • Jan 20 2017 | 7:31 pm
      Thanks a lot Rob!
    • Sep 10 2019 | 8:00 pm
      Hiya Rob - found this topic while trying GL3 thats just released. All the demo projects keep acting up on my machine and the gl.buffer object becomes unavailable. Whats up with that? "jit.gl.buffer: jit.gl.scene: could not allocate object" I assume a machine restart will clear it up, but I got it working by uninstalling and installing GL3 package earlier. Now that isn't working. So not sure how to clear it up. Thanks