Bug in jit.gl.render ? colored alpha channel

    Mar 14 2014 | 3:01 pm
    Hello List,
    I am trying to send my render output with alpha channel with syphon to another application. It works well, if i set the erase_mode of my jit.gl.render to clearcolor.
    But if i blend my content, it has always the background color of my jit.gl.render object inside.
    Here is a patch, which simulates the problem. I woud expect, that the shape at the copy_context window is not colored.
    Perhaps someone had the same problem and solved it.

    • Mar 14 2014 | 5:41 pm
      use jit.gl.node and set the node's @erase_color to 0 0 0 0:
    • Mar 14 2014 | 6:04 pm
      Hello Rob,
      Thanks for the nice trick, but my patch is a bit more complex. I have many (hundreds) gl elements capsulated inside different poly~ objects.
      I found no way connecting them to jit.gl.node ... Perhaps there is also a little trick to connect them without wires ;-)
      Greetings, abs11
    • Mar 14 2014 | 6:33 pm
      Ahhhh ... Got it now. @name attribute of jit.gl.node is my friend :-) Sorry for the noise ...
    • Mar 14 2014 | 7:15 pm
      Hey Rob,
      Get strange results, using jit.gl.node @capture 1, if I bang my gl objects manually. (@automatic 0) Everythin is fine @automatic 1 ...
      Here is an example based on the jit.gl.node helpfile. - no texture output - the videoplane still 3 dimensional @capture 1
      Btw is there no chance to get it working without jit.gl.node ?
    • Mar 17 2014 | 11:47 am
      Hello All,
      I am a bit lost. I did not found a solution to grab a texture of my render context with the correct alpha channel, if i trigger my open gl objects manualy. (@automatic 0)
      1) The to_texture method of gl.render outputs a wrong alpha 2) There is no texture output, if i use jit.gl.node. gl object @automatic is set to 0
      I dont think, that it a very advanced setup ;-) Perhaps someone has found a solution or workaround.
      Or will these bugs fixed ??? Greetings, abs11
    • Mar 17 2014 | 9:28 pm
      capturing with jit.gl.node only supports automatic mode drawing.
      maybe try setting your gl.render @erase_color to 0 0 0 0
    • Mar 18 2014 | 12:55 am
      Hello Rob,
      gl.render @erase_color to 0 0 0 0 always copies black into the alpha channel.
      Is there any hope, that we get a fix or workaround to get a proper alpha out of a render context ?
      Greetings, abs11
      Here is a patch:
    • Mar 18 2014 | 6:33 pm
      the texture you capture to must be float32 instead of the default of char. send the message "type float32" to the texture, after your init rendering.
      for some reason, setting the type only works after the render context is initialized, so setting it in the max box with @type float32 doesn't work.
    • Mar 18 2014 | 7:12 pm
      Hello Rob,
      Thanks for the tip, but sadly the "type float32" message changes nothing here. The alpha channel still has black inside. Check the difference between the "original_context" and the "copy_context" while blending the gridshape.
      Btw. i am working on max 6.1.6 and 10.8.5 in 32bit mode
      Here is my patch, after 4 sec. the texture should be float32.
      Greetings, abs11
    • Mar 18 2014 | 8:10 pm
      the difference is because you have blend_enable 1 on you jit.gl.videoplane:
    • Mar 19 2014 | 6:42 pm
      Hey Rob,
      First i want to thank you for your patience !
      But "blend_enable 0" is not an option, because then the alpha channel is gone. (I need it in the receiving application) It is difficult to describe with a single gridshape, so i made a new patcher.
      It has a white plane with a gradient as an alpha channel. There are only white pixels in the original_context. I see a lot af grey pixel here.
      Perhaps i am wrong, but for my understanding the copy_context should be white. If you change to blue (erase_color 0. 0. 1. 0.), the pixel gets blue.
      Greetings abs11
    • Mar 20 2014 | 4:43 pm
      sorry, i'm not seeing any unexpected results over here. below is what i'm seeing when i open your patch, change the orginal-context erase color to blue, and the copy context erase color to pink.
      it looks exactly like i would expect.
    • Mar 20 2014 | 5:05 pm
      Hello Rob,
      Perhaps this behaviour depends on the gpu. Mine is an "AMD Radeon HD 6750M"
      I have also added a single white line. At the copy_context there you always see the erase_color of the original_context.
      The output looks like this. scrennshot_blue.png screenshot_black.png
    • Mar 20 2014 | 5:54 pm
      BTW The output is exactly the same on a mac mini (gpu: NVIDIA GeForce 9400) The expectation is that the copy_contex is white ;-)