I need a video behind a few OpenGL-objects. What's the best way to do? As a texture, or is there a possibility to make the background of the GLControl transparent (But only the background, not the objects)?
Posted Saturday, 30 October, 2010 - 04:16 by Inertia
[Insert name of favorite search engine here] is your friend. ;)
A transparent canvas is not the way to go. Try doing all video reading/decoding/texture uploads in a second context/thread and use the primary thread to cycle through textures of the video stream. (Don't decode only a single frame, preallocate something like 10 spare textures and cache ahead.)
Posted Saturday, 30 October, 2010 - 16:19 by sgsrules
Also use PBOs when updating your textures. If you want your video to always be in the background clear your depth buffer before drawing anything else. If you need a good video library try ffmpeg you'll have to find a adequate .net wrapper or write your own.
Comments
Re: Video as background in OpenGL
[Insert name of favorite search engine here] is your friend. ;)
A transparent canvas is not the way to go. Try doing all video reading/decoding/texture uploads in a second context/thread and use the primary thread to cycle through textures of the video stream. (Don't decode only a single frame, preallocate something like 10 spare textures and cache ahead.)
Re: Video as background in OpenGL
Also use PBOs when updating your textures. If you want your video to always be in the background clear your depth buffer before drawing anything else. If you need a good video library try ffmpeg you'll have to find a adequate .net wrapper or write your own.
Re: Video as background in OpenGL
Thanks to both of you so far.
I'll give it a try. First I have to read something about PBOs; Sounds like a good solution.
Re: Video as background in OpenGL
Well, it works so far. The only thing: It takes a lot of CPU-Usage. Does anyone of you know a sample using pbo's? I can't find something useful...
Re: Video as background in OpenGL
This is the PBO example I typically refer to: http://www.songho.ca/opengl/gl_pbo.html (just drop the "ARB" suffices).
Re: Video as background in OpenGL
Thanks for the link. Very good description!
Unfortunatly the cpu-usage is still high. Maybe it comes from the video-source.
But thanks for the help to all
Re: [solved] Video as background in OpenGL
Hello Thomas,
could you share your solution here? I am really interested in how you managed the opengl overlay objects
Thanks,
David