Closed neilcsmith-net closed 6 years ago
Just a quick question: how I can enable alpha in a shader inside custom video components? I’m trying to add transparent pixels in the shader, but in the output video stream alpha is rejected.
I’m playing with 4.0-rc1 and using https://github.com/praxis-live/pxg/blob/master/VideoGL/gl-filter-base.pxg as a base.
From this issue it seems like you have addressed that, but I can’t find how to do that :(
Thanks!
Actually, the fix is the same in v3, but perhaps needs better documentation?! Surfaces are opaque by default. You need to add a video:composite
after your shader component and set force-alpha
to true. Anything connected to src
will then have an alpha channel.
This issue was about adding the functionality to be able to re-code these, or do this within any custom component. It's slightly weird to use - need to add a function to the video input and it must be done in init()
because setup()
happens after the video sources have been called - see https://github.com/praxis-live/praxis/blob/develop/praxis.video.components/src/org/praxislive/video/components/VideoComposite.java#L62
I think this only works in video:custom
based components at the moment - need to check - was at least planning to add it to P2D
and P3D
as well.
video:composite
- requires ability to force an alpha channel on inputPImage
.video:xfader
- requires ability to switch off rendering of an inputPImage
.video:player
andvideo:capture
- need to make GStreamer wrappers that extendPImage
video:gl:filter
- replace with current custom base source and filter? Currently don't have default uniforms - easier for users to have them or not?