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;
}
--
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.