Released testing 241002-d745a3
:
-
[Pi4/5] Improved overlap tests for video content. If multiple videos partially overlap, covered areas will not be drawn in most cases. This can greatly improve rendering performance.
-
Incompatible change in some very rare cases: Moved all rendering to premultiplied alpha blending. This is something that should have been done from the very start, but is necessary now due to how video rendering on the Pi4/5 works to ensure 90/270 degree rotated videos render correctly in all cases. In very rare cases when using custom fragment shaders in custom packages could this change result in incorrect visual output. If you have shader code like this:
gl_FragColor = vec4(1.0, 0.0, 0.5, alpha);
you must now use the following code if info-beamer uses premultiplied alpha, so the alpha value is multiplied to the RGB components:
gl_FragColor = vec4(1.0*alpha, 0.0, 0.5*alpha, alpha);
You can detect if this change is needed, in case you use a mix of old and new versions using:
if sys.provides "premultiplied-alpha" then -- use new premultiplied-alpha shader else -- use old shader end
info-beamer tries to automatically patch existing shader code used with
resource.load_shader
based on a heuristic (which you can disable withnode.set_flag "premultiplied-alpha"
, in which case premultiplied alpha use is assumed):-
If there is a `uniform vec4 Color;" import in the shader, nothing is patched, as it is assumed that the color is multiplied with the result already like this:
gl_FragColor = the_shader_result * Color;
in which case it’s assumed that the primary alpha value is within
Color
. As that’s already premultiplied, nothing needs to be done. -
In all other cases, the following code is patched before the closing brace within the
main
function:gl_FragColor.rgb *= gl_FragColor.a;
If you have any questions about this, please get in contact!
-