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
multi texuture using one picture
-
hybrid
- Admin
- Posts: 14143
- Joined: Wed Apr 19, 2006 9:20 pm
- Location: Oldenburg(Oldb), Germany
- Contact:
Re: multi texuture using one picture
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.
Re: multi texuture using one picture
yeah, that helps a lothybrid 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.
thx!