Sign in to follow this  

2d Video On A 3d Surface

This topic is 3593 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello all I was wondering how you put 2d Video on a 3d Object. Here's a breakdown of my scenario, I'm wanting to put a user definable video file playback onto a 3d mock-up of a television. Now what I'm wanting to do is have VLC be the video player that is rendered to the 3d object (don't worry about advice on how to do that, I'll just get the source from their website). What I'm asking of you guys is how (in pseudo code, non language-specific please) in theory this should be done. Like does most 3d libs like Torque, XNA, Irrlicht or OGRE have a video to 3d billboard or similar feature? Or perhaps does one write some code to parse the frames into gifs or such and UV Map them one at a time (I sincerely hope this isn't how it's done since FPS's would be deplorable). I thank you all for your time and effort in helping me, --Alex (http://www.axpen.com/)

Share this post


Link to post
Share on other sites
Maybe some engines have such capability, but generally you will have to load in frame by frame and constantly update the texture of your "TV" object with the new video frame. The performance is not as bad as you might think. You can improve the situation by using the correct texture format and correct flags (eg. tell your renderer it is a "streaming" texture if it has such a concept), having the video already the correct size (power of two, if that is a requirement of your renderer), having the video already contain the alpha channel if you plan on doing masking, taking advantage of any special hardware and/or extensions available to you through your renderer, and then being smart about frame rate and image size (you probably won't be able to stream a 1024x1024 video @ 60 fps). I had no problem streaming 5 videos at once and maintaining 60fps using Direct3D and no special magic. The videos were 256x256 and I streamed them at 15 fps.

Share this post


Link to post
Share on other sites
First of all thanks for the great advise and quick response.

Out of curiosity what did you use to display the video (decode it that is), like VLC, MPlayer or Windows Media Players Direct Show? I'm just trying to make sure the path I choose with VLC is a viable one, since I'm not too sure about VLC's speed in decoding video (although I do know it has massive capability to do streaming).

I think you're right on the money with what you said, the games that I've seen make me want to do this don't go far beyond that level of stream. The Sims' just do little animated gifs for the TV's and 2k's The Darkness has a hobo with a TV you can watch (mostly) full length video clips, but it's only on a maybe 256x256 screen like you said.

Thanks again for the response,
--Alex (http://www.axpen.com/)

Share this post


Link to post
Share on other sites
I have used DirectShow and I have also used the AVI family of functions in the Windows multimedia library. There was no discernable difference in performance. I was not taking advantage of the VMR filter which I believe has the ability to write directly to a Direct3D texture surface, so you might see some speed up there. I have never used VLC in a project, but from the little bit I have seen I'm sure it is perfectly capable of doing what you want.

Share this post


Link to post
Share on other sites
Also just on a side note, I have heard great thinks about bink video and that it can play on surfaces in 3d. It also appears to be free if you display the logo and if you want to eliminate that then the fee is only 1,995.00 USD, not too bad for all the games that have used it.

Share this post


Link to post
Share on other sites

This topic is 3593 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this