Video Tag does not create Textures properly in Chrome using webm with an Alpha Channel

38 views
Skip to first unread message

Ladar

unread,
Jun 28, 2014, 10:40:20 PM6/28/14
to chromiu...@chromium.org

I am trying to Layer multiple video sources in WebGL in Chrome.

When I create a texture from the video tag in Chrome, with a Video that has an Alpha channel (webm) the resulting texture contains the frames of all the previous frames that were displayed. It looks similar to what would happen if I wasn't calling gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT) but only in the texture. If the texture does not contain Alpha (And thus has to redraw the entire video space) then it works fine.


function handleCanvasTexture(texture,  //Already Created Texture
                             textureCanvas // Video Tag that plays the video
                             ) {
if (video.src != "" && video.readyState == 4){
        gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, true);
    gl.bindTexture(gl.TEXTURE_2D, texture);
    gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, textureCanvas); // This is the important line!

    gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
    gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
    gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);

    gl.bindTexture(gl.TEXTURE_2D, null); // unbind the Texture

return;
}

PhistucK

unread,
Jun 29, 2014, 2:18:55 AM6/29/14
to Ladar, Chromium HTML5
Sounds like a bug. Can you, please, look for an existing issue at crbug.com and if you do not find one, create one?

Thank you.


PhistucK


--
You received this message because you are subscribed to the Google Groups "Chromium HTML5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-html...@chromium.org.
To post to this group, send email to chromiu...@chromium.org.
Visit this group at http://groups.google.com/a/chromium.org/group/chromium-html5/.
For more options, visit https://groups.google.com/a/chromium.org/d/optout.

Kenneth Russell

unread,
Jun 30, 2014, 1:25:17 PM6/30/14
to PhistucK, Ladar, Chromium HTML5
Agreed, sounds like a bug. It sounds like the portions of the video
that have alpha < 1 aren't being cleared properly frame-to-frame.
Could you please file a bug and provide a small test case? Please post
the bug ID here once filed.

Thanks,

-Ken
Reply all
Reply to author
Forward
0 new messages