I am making a simple game (Using Directx-11 - C++ - Win32) and i am trying to add a cut scene for my Game's Intro, effectively trying to play a video but not sure how to do that. Any suggestions would help.
Cut-Scene using Directx11
- rendered/ animated realtime
- playing a pre-recorded video
If it's option 1, you could store a list of absolute positions/ rotations etc. For your objects and camera (or incremental if you like), and then "play" that realtime to get the needed cutscene.
If you go for option 2 you could google for more information, for example "ingame video d3d11". I know aaa games use bink for example, not sure if that also works for us "hobby developers".
Crealysm game & engine development: http://www.crealysm.com
Looking for a passionate, disciplined and structured producer? PM me
Thanks for your response. In my case its option 2 and i did try googling found nothing useful. Also, had an outside thought of breaking down video into images and rendering images at a frame rate but don't really want to do that. Looking for someway to just play the video as it is using dx11 APIs.
https://msdn.microsoft.com/en-us/library/windows/desktop/ms694197(v=vs.85).aspx
I don't have any idea yet how one would render the last frame of an in game video at one point and present the first frame of a dx11 swap chain right the next but I guess it can be done if AAA games do this.
I'm not sure if there is an easy way to do what you want in DirectX however in OpenGL you would use a library to decode the video, and then grab each frame and render it onto a surface. You also have to be careful with playback if you are synching the video to the audio stream.
Have a look at FFmpeg: http://www.ffmpeg.org/
or Theora: http://www.theora.org/
--- @www.CreateStones.com
Here's an example that might help:
https://code.msdn.microsoft.com/windowsapps/DirectX-11-Video-Renderer-0e749100
Crealysm game & engine development: http://www.crealysm.com
Looking for a passionate, disciplined and structured producer? PM me