multi texuture using one picture

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
noovel
Posts: 4
Joined: Wed Apr 24, 2013 1:43 am

multi texuture using one picture

Post by noovel »

hi, newbie here

I read the code of irrlicht
and want to make some change to emitter

now i want to use multi textures in one emitter, textures of particles are varied
i think it is ugly to load many different pictures to achieve the goal
my quesion is, can i use just one picture which contains all the textures I want?
Different textures derived from one picture, is it possible?

I'm not sure if anyone has asked similar questions, however I've searched it but no satisfyingresults came out
#my english is poor, if there is something not clear, I will try to explain it
#thx & bow
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Re: multi texuture using one picture

Post by hybrid »

Yes, the thing here is texture atlas and texture matrix. Things which are also used for sprites. You should get some code when searching for those terms in the forum search. What you basically do is putting all textures (same size is easiest) into one huge texture. Better not exceeding 2048x2048 pixels, but that should be enough anyway. Then you use a particle emitter or animator, which alters the texture matrix in such a way that the proper portion of the texture is chosen.
noovel
Posts: 4
Joined: Wed Apr 24, 2013 1:43 am

Re: multi texuture using one picture

Post by noovel »

hybrid wrote:Yes, the thing here is texture atlas and texture matrix. Things which are also used for sprites. You should get some code when searching for those terms in the forum search. What you basically do is putting all textures (same size is easiest) into one huge texture. Better not exceeding 2048x2048 pixels, but that should be enough anyway. Then you use a particle emitter or animator, which alters the texture matrix in such a way that the proper portion of the texture is chosen.
yeah, that helps a lot
thx!
Post Reply