PNG Transparency on Open GL Object

Noah Mitchell's icon

How can I get the transparency of a png image to work when I texture say for example a jit.gl.videoplane....I am sometimes able to achieve this by using blend enable and messing around with blend modes, but the results are far from consistent...there has to be an easier way to do this....Let me know if you know any solutions

Noah

Rob Ramirez's icon

the jit.gl.layer object is setup for displaying transparent images by default. Use the @layer attribute to control the draw order when drawing more than 1.

jit.gl.layer is simply a jit.gl.videoplane object with depth_enable 0, blend_enable 1, and preserve_aspect 1

Noah Mitchell's icon

I tried that and it still isn't working for me...I'll attach my patch...I'm just uploading a PNG file to the matrix, but still getting the black background

PatchTest.maxpat
Max Patch

Pedro Santos's icon

I think the problem is before the jit.gl.texture, probably jit.movie isn't outputting the alpha channel.
Anyway, you don't need jit.movie > jit.matrix to load the image, you can do it directly to jit.gl.texture.
This way, it's working.

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

Noah Mitchell's icon

Works like a charm...thanks Pedro, much love to you for taking the time to help

Noah