Bug in jit.gl.render ? colored alpha channel
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.
use jit.gl.node and set the node's @erase_color to 0 0 0 0:
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
Ahhhh ...
Got it now.
@name attribute of jit.gl.node is my friend :-)
Sorry for the noise ...
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 ?
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
capturing with jit.gl.node only supports automatic mode drawing.
maybe try setting your gl.render @erase_color to 0 0 0 0
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:
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.
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
the difference is because you have blend_enable 1 on you jit.gl.videoplane:
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
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
BTW
The output is exactly the same on a mac mini (gpu: NVIDIA GeForce 9400)
The expectation is that the copy_contex is white ;-)