Archived

This topic is now archived and is closed to further replies.

Boris Karloff

DirectShow8 -> Render video to D3D8 backbuffer?

Recommended Posts

I''m wondering if it''s possible to render frames from a video file directly to a D3D backbuffer, to use, for instance, as a background for the scene. I''ve been looking into the media detector, for instance, but this grabs a frame and returns a bitmap header and bitmap bits, which I doubt are usable on the backbuffer. What would be really great is if one could edit the basic "render a video" filter graph so that it renders all video not to the screen but directly to a specified back buffer, or a D3DSurface at least. Does anyone know if such a thing is possible? The Texture 3D sample that comes with the DX8 SDK is an example of rendering to a surface (or actually a locked texture), but it basically involves getting a pointer to the IMediaSample''s buffer, and copying it bit-by-bit to the locked texture. Wouldn''t it be useful to skip the copying step, and specify that the sample shouldn''t be rendered to the buffer, but directly to the specified locked texture? It would prevent a potentially slow copy... Anyone know if such a thing is possible? Or any other way of rendering a video directly to a D3D texture/surface/backbuffer?

Share this post


Link to post
Share on other sites
Only D3D9 supports video to a 3D surface. DX8''s DirectShow is limited to DDraw surfaces, which is interesting since they pretty much got rid of DDraw at that point. You can play to a DDraw surface, lock it, lock your 3D surface, copy, unlock both, then render using that texture.... just don''t expect it to be smooth, fast, or otherwise terribly useful.

Another option that most game companies have used is to use Bink video from RAD tool, simply because DirectShow doesn''t cut it. Chances are that half the games you have played use Bink.

Share this post


Link to post
Share on other sites
quote:
Original post by Namethatnobodyelsetook
Only D3D9 supports video to a 3D surface. DX8's DirectShow is limited to DDraw surfaces, which is interesting since they pretty much got rid of DDraw at that point. You can play to a DDraw surface, lock it, lock your 3D surface, copy, unlock both, then render using that texture.... just don't expect it to be smooth, fast, or otherwise terribly useful.



Hmm.. Okay, so I guess locking and copying is pretty much the only way in DX8. I read about the DX9 possibilities of rendering to a D3D9 surface.. Is -that- kinda smooth, fast or otherwise somewhat useful?

quote:
Original post by Namethatnobodyelsetook
Another option that most game companies have used is to use Bink video from RAD tool, simply because DirectShow doesn't cut it. Chances are that half the games you have played use Bink.



Hmm, yeah, but Bink ain't free, and DS is. Could be worth spending the money on, though...

Okay, thanks for the advice.


quote:
Original post by Wavewash
As I recall there is a sample application in the dx8 sdk that has an AVI playing on a cylinder. It's called texture3d and it's in the directshow folder.



Yeah, thanks. I kinda mentioned that in my post too, plus why it's not what I'm looking for. Thanks anyway, though.


[edited by - Boris Karloff on January 24, 2004 12:15:20 PM]

Share this post


Link to post
Share on other sites