Original Post
The setup: Video stream in format: GL_RGB Using glTexImage2D / glTexSubImage2D to display the video stream to a texture rendered onto a quad. The problem: I have read that using glTexSubImage2D with a non-GL_RGBA texture is slow since the video driver needs to reformat the texture to GL_RGBA. When I do this with video it ends up slowing down the process. I call glTexSubImage2D after each frame is ready to display (~30Hz) and a 1280 x 480 video stream slows the process down to 14 Hz(fps). Changing the glTexSubImage2D to use GL_RGBA seems to greatly increase the performance of the process although it will not render the image correctly since I'm still giving it a GL_RGB stream. I added a simple function that will pad the RGB stream with an alpha channel but that ends up slowing the process down further. The question: Rendering video using openGL is a fairly common task and video rarely (never?) comes with an alpha channel. How do others render the video quickly enough with high resolutions? I tried glDrawPixels but that is much slower. Is there a quick way to pad the RGB stream with an alpha channel?