[SOLVED] animated textures

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
ritti
Posts: 90
Joined: Tue Apr 10, 2012 12:09 pm

[SOLVED] animated textures

Post by ritti »

Hi, I'm trying to make animated textures for my strategy game.
E.g if I build a unit, the texture of the building should blink (I need it for more complicated things too so only blink wont be enough).
but as I just read, irrlicht doesn't support .gif textures.

So I'm not sure how to achieve that.
I could make an array or a vector with every single texture and switch between them but it seems not the best way.
How should I do that?
I hope you can help me.

Best regards
Ritti
Last edited by ritti on Thu Jul 26, 2012 6:28 pm, edited 1 time in total.
CuteAlien
Admin
Posts: 9926
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: animated textures

Post by CuteAlien »

Maybe you can use ISceneManager::createTextureAnimator: http://irrlicht.sourceforge.net/docu/cl ... 735d22d04a

Or if that's not sufficient it might at least give you some ideas how to create an own animator doing what you need.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
hendu
Posts: 2600
Joined: Sat Dec 18, 2010 12:53 pm

Re: animated textures

Post by hendu »

Doing a blink by changing textures is expensive. Just use a shader to do the blinking, and keep one constant texture ;)
gerdb
Posts: 194
Joined: Wed Dec 02, 2009 8:21 pm
Location: Dresden, Germany

Re: animated textures

Post by gerdb »

or use different uv coords with a texture-atlas
mongoose7
Posts: 1227
Joined: Wed Apr 06, 2011 12:13 pm

Re: animated textures

Post by mongoose7 »

You could register two textures and just swap between them.
zhengxianfu
Posts: 16
Joined: Thu Apr 05, 2012 9:33 am

Re: animated textures

Post by zhengxianfu »

createTextureAnimator is very expensive , my Samsung I9100 can not display the example.

At last ,i update the texture by setmeterialtexture,I think that Irrlicht will cache the textures ,so it's very fast.
ritti
Posts: 90
Joined: Tue Apr 10, 2012 12:09 pm

Re: animated textures

Post by ritti »

Thank you for your replies, I'll play around with the different ways so I'll see whats the best for my needings.
Thx again
Ritti
Post Reply