I’m reading that newer browsers have alpha support, I guess it depends on the codec, how we render may also (help?) with allowing transparency in the video if its encoded with an alpha channel
How do you set
-Dcanvas in the project?
Let me know if anyone can help me with that.
with “that” what exactly?
In project.xml you need to put this line
<haxedef name='canvas' />
So, as of OpenFL 8 what would be the best method of implementing video with alpha channel using WebGL target? I have old flv video with alpha currently and presumably would need to convert it to something.
I’m currently exploring these methods:
And there’s animated PNG; don’t know if OpenFL supports that at all.
Does standard HTML5 video support alpha?
My research seems to indicate that only browsers supporting the WebM or H.265 codecs would have that ability. Safari is the bad boy there, with no WebM support. Safari and Edge are the only ones supporting H.265 in any aspect.
Hmm, so perhaps two videos, one with an alpha channel, and copying from one to the other, but seems tricky. Do you need an animated alpha channel, or a constant one?
Yes it does seem tricky. Does the html target render the video right in the WebGL stage or Canvas, or does it overlay? I have no immediate need but am doing some research just in case I get asked to convert a certain old project. It does currently have an animated alpha channel, which was generated from green screen.
We draw to canvas (which is a bit slow I think) but on WebGL (when supported) we render as a texture. That gives us support for making effects in the shader, such as masking or blending multiple textures
So in the rendering-as-texture: if the browser actually supports alpha in a regular video, I wonder whether the alpha would be retained in the texture rendering. If not, one would have to do a workaround like the method described at http://www.sciencelifeny.com/transparency/transparency.html. That’s about all I will explore for now, so thanks for your help!