overlap of meshes on video footage

Post your questions, suggestions and experiences regarding to Image manipulation, 3d modeling and level editing for the Irrlicht engine here.
Post Reply
pyandrea
Posts: 11
Joined: Sun Jul 13, 2014 7:01 pm

overlap of meshes on video footage

Post by pyandrea »

I would like to develop an isometric platformer (like Congo Bongo for SEGA Master System) with the the following major features:
1) main character and enemies consist of animated meshes;
2) the background is animated and consists of real-world footage; ideally, a looping video (e.g. .avi) or a set of images
3) the position of the platforms is specified by 'invisible' meshes but the shadows of the main character/enemies are projected onto the video background.

Please, can you suggest me a way of developing this idea in Irrlicht?
Specifically, I am interested on the way of overlapping meshes to the video background.
christianclavet
Posts: 1638
Joined: Mon Apr 30, 2007 3:24 am
Location: Montreal, CANADA
Contact:

Re: overlap of meshes on video footage

Post by christianclavet »

Putting a video in the back is a bad idea. Your game size will get monstruous in file size and the experience will vary a lot from user to user (screen resolution could show the pixels if your resolution is not full HD or more). Why don't you put pictures in the background instead? (You could layer animated elements over using the alpha channel of the textures)

For this you only need a flat 3D plane containing a texture. If you take high resolution pictures of your background and only put little elements that are animated over, it should take lot less space and less overhead.
chronologicaldot
Competition winner
Posts: 688
Joined: Mon Sep 10, 2012 8:51 am

Re: overlap of meshes on video footage

Post by chronologicaldot »

No animated gif loader for irrlicht yet. Oh well. One day...
hendu
Posts: 2600
Joined: Sat Dec 18, 2010 12:53 pm

Re: overlap of meshes on video footage

Post by hendu »

Would you like to hire me to build one?
pyandrea
Posts: 11
Joined: Sun Jul 13, 2014 7:01 pm

Re: overlap of meshes on video footage

Post by pyandrea »

Why don't you put pictures in the background instead? For this you only need a flat 3D plane containing a texture. If you take high resolution pictures of your background and only put little elements that are animated over, it should take lot less space and less overhead.
I understand your point. However, my idea is to have a 'real' fluvial scenario as the background of my game. Specifically, the idea is to show a scene with (a) a flowing river (b) levees with trees (c) leaves blown by the wind. Given the complexity of the scene, it is very difficult to have a high resolution picture with animated elements.
pyandrea
Posts: 11
Joined: Sun Jul 13, 2014 7:01 pm

Re: overlap of meshes on video footage

Post by pyandrea »

christianclavet wrote:Putting a video in the back is a bad idea. Your game size will get monstruous in file size and the experience will vary a lot from user to user (screen resolution could show the pixels if your resolution is not full HD or more). Why don't you put pictures in the background instead? (You could layer animated elements over using the alpha channel of the textures)

For this you only need a flat 3D plane containing a texture. If you take high resolution pictures of your background and only put little elements that are animated over, it should take lot less space and less overhead.
I will try to follow your advice (although - as I stated in the previous post - i have some issues related to the complexity of the scene). If I understood well, the basic idea is to use a Billboard:

scene::ISceneNode * node1 = smgr->addBillboardSceneNode(0, core::dimension2d< f32 >(sizeX,sizeY));

and then change the background during each frame:
node1->setMaterialTexture(0, driver->getTexture("../../media/frame1.png"));
node1->setMaterialTexture(0, driver->getTexture("../../media/frame2.png"));
node1->setMaterialTexture(0, driver->getTexture("../../media/frame3.png"));

Newbie qiestion: how to set the size of the billbord as large as the screen? If I use screen resolution as sizeX and sizeY the texture gets stretched!
hendu
Posts: 2600
Joined: Sat Dec 18, 2010 12:53 pm

Re: overlap of meshes on video footage

Post by hendu »

You want a screenquad, not a billboard; see the snippets forum for many ones.
christianclavet
Posts: 1638
Joined: Mon Apr 30, 2007 3:24 am
Location: Montreal, CANADA
Contact:

Re: overlap of meshes on video footage

Post by christianclavet »

Humm. If the texture get stretched it's because the aspect ratio of your screen is different from the texture.
You would have to size your billboard by calculating a proper aspect ratio for it whatever the screen aspect ratio.

Another trick would be to use a simple flat plane, and assign a texture to it, but the billboard approach is the simpler. A screenquad node would be nice as hendu mentionned, but just not sure, if you were to position other textures over, you would surely need to modify the code a little so it support some kind of layering. A Screenquad is used normally to have the final rendering when using a post-process shader.

Another note: try to disable mipmap creation when setting the texture, it take some time and you don't need it for this purpose. I would also use a sequence of JPEG as PNG are bigger files and will take a longer time to load.
Post Reply