Animated textures? Better loaders?

Discuss about anything related to the Irrlicht Engine, or read announcements about any significant features or usage changes.
Post Reply
christianclavet
Posts: 1638
Joined: Mon Apr 30, 2007 3:24 am
Location: Montreal, CANADA
Contact:

Animated textures? Better loaders?

Post by christianclavet »

Hi, Is there any format for textures that would support animation (as GIF animated but with 24 bits + alpha pics)?

I was looking at one of theses games.
Image

Having this we could select a frame for a texture and change expressions on characters like the LEGO characters.

I think it's possible to do it using a sequence of JPEG files. But would have to unload the textures once it's has been changed. For an expression system, specific frames associated with an expression an the engine (AI or script) would change it.

This could also be useful for lots of things (animated skydome, skybox, textures being damaged after an impact, and the list goes on..)

This could even be used as a cheap way to do video into IRRlicht (Using the new filesystem; The JPEG file sequence could be stored inside a ZIP file, it would then be faster to retrieve from the disk).

Anyway it's just ideas that I had, no time right now to try to implement something to check how it can be done.

Still there would still a need to load this asyncronously. I was wondering if there could be an easier way to do it. Do you have plans to improve the file loaders so that they can work that way? (Sorry if it's the X times I ask for asyncronous loaders, IRRlicht 1.6 is now out...)
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Just load the frames into a large texture. These textures should be 128x128, so you could store 8x8 of them in a 1024x1024 texture. Then just use texture matrices to animate them.
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

Yeah i don't think anything like GIF would really make it any easier for you... GIFs are horrible quality anyway and they'd take up as much memory anyhow as they'd have to be uncompressed in memory so you'd end up with the same amount of memory usage as if you just used a load of .jpg images.
Image Image Image
christianclavet
Posts: 1638
Joined: Mon Apr 30, 2007 3:24 am
Location: Montreal, CANADA
Contact:

Post by christianclavet »

Thanks Hybrid! I did not think about this trick. Does IRRlicht have "texture matrices" functions?

Hi JP! Yes, I was looking for a GIF equivalent (animation feature inside the format) but that would support 24 bit with alpha.

Since we don't have loaders that are ayncronous, I was thinking I could "preload" textures at "loading time". So this should not stop the animation since the textures will already be in memory. The only thing is that will limit the size on the animations I would do.
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

Well you can always preload any necessary textures at loading time, it's what I do as otherwise when you request them at runtime you'll get stalls for larger textures.
Image Image Image
Post Reply