Bug 273006

Summary: texImage2D loses alpha from transparent video
Product: WebKit Reporter: Brendan Duncan <brendanduncan>
Component: WebGLAssignee: Nobody <webkit-unassigned>
Status: NEW    
Severity: Normal CC: dino, karlcow, kbr, kkinnunen, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: macOS 14   
Attachments:
Description Flags
Repo test for WebGL alpha video blending none

Brendan Duncan
Reported 2024-04-19 13:05:53 PDT
Created attachment 471015 [details] Repo test for WebGL alpha video blending Given an HEVC (or any other supported codec w/ alpha, such as ProRes), uploading the video frame to a WebGL texture with texImage2D will not preserve the alpha channel of the video frame and the texture will be opaque. This only happens on Safari, not on Chrome on MacOS with the ANGLE Metal or GL backends. Drawing the texture on a quad with alpha blending enabled, the texture is opaque. Putting the video on the HTML DOM with a Video element, the video has transparency. It's only opaque when uploaded to WebGL. I attached a small repo test.
Attachments
Repo test for WebGL alpha video blending (3.70 MB, application/x-zip-compressed)
2024-04-19 13:05 PDT, Brendan Duncan
no flags
Kenneth Russell
Comment 1 2024-04-19 16:13:45 PDT
https://github.com/KhronosGroup/WebGL/blob/main/sdk/tests/conformance/textures/misc/texture-video-transparent.html was added to the WebGL conformance suite in an attempt to cover scenarios like this. Please feel free to propose additional cases if this bug has uncovered an untested scenario.
Brendan Duncan
Comment 2 2024-04-19 16:46:22 PDT
I just checked the conformance test and it does fail on Safari
Radar WebKit Bug Importer
Comment 3 2024-04-26 13:06:15 PDT
Note You need to log in before you can comment on or make changes to this bug.