0

I've got various effects for a game stored in mpeg video files, each few seconds long. An example frame of the video looks like this:

I want to display it with lighten blending mode (replace darker pixels with video, do not touch pixels brighter than video), is it going to be feasible with C# and XNA or would that be better if I would have chosen different way to store animations with sounds?

Community
  • 1
  • 1
Sebi
  • 1,390
  • 1
  • 13
  • 22
  • I've never done anything like this before, but I guess you can make a custom shader to achieve described effect. If your question is whether it can be done with XNA, I believe it can be done with anything that supports shaders (like XNA). – user1306322 Feb 16 '13 at 10:54
  • @user1306322 But how would I get it to render and to be treated as texture so that shader can sample currently played frame? – Sebi Feb 16 '13 at 11:07
  • 1
    As I've said, I never worked with videos, but I did make [animated gif to frame strip](http://stackoverflow.com/questions/10013612/converting-animated-gif-file-into-a-bmp-strip/13858533#13858533) application earlier. Using that might work, but I think that'd be terribly costly performance-wise. You should have a look at XNA's media classes, there must be some video class that supports grabbing current frame. If not, I bet there are some free third-party alternatives. Anyway, is using XNA critical to solve your problem? – user1306322 Feb 16 '13 at 11:11
  • Thank you, I'll have a deeper look into it. Only one clip of resolution not exceeding 600x600 is going to be played at once so the performance is not critical but I'll look for better solution. Ad using XNA: I'm making a 2D game in XNA and those clips are only animated effects so since I already use XNA, I have to display it within XNA. – Sebi Feb 16 '13 at 11:19

0 Answers0