praxis-live / support

Documentation and issue tracking
9 stars 2 forks source link

Finish converting video components to be re-codeable #79

Closed neilcsmith-net closed 6 years ago

neilcsmith-net commented 6 years ago
y8 commented 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!

neilcsmith-net commented 6 years ago

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.