I want to setup a grid texture, say 128x128, broken out into 64x64 tiles, and each tile have a different little sprite in it… like you would for an animated texture.
What i would like to do is have the particle system randomly PICK a tile within that texture. Any easy way to do that? I can get it to animate but i’m not looking for that… just want it to use one of those.
Cheers!
Bryan Pritchard
CEO/COO
Annosoft Entertainment
You can use several different materials with a particle renderer, and it will choose at random from those materials when creating particles. Just set the size property of the particle renderer’s materials array to the number of materials you are using and drag the materials into the array.
You can use different areas of the same texture in isolation with the different materials. If you set the material’s tiling value to 0.5, then an area half the size of the total texture will be used. You can then use the offset value to set a UV coordinate where the area will start.
I would like to achieve the same effect of randomly using different quadrants of a 4-up particle texture.
Andreee, I understand what you are doing by changing the material’s tile and offset values, however when I try to adding multiple materials in my particle renderer the result is not what I expected. Instead of randomly choosing one material, it renders both materials on top of each other. So each particle that is spawned, renders material_1 (texture quadrant1) with material_2 (texture quadrant2) overlaid or added on the same particle sprite. Any suggestions or steps I am missing?
You could isolate the separate sections of the 4-up texture by creating four materials and using the tiling and offset parameters. Would simply using four separate particle systems at the same position give the effect you are looking for or is it more subtle than that?
If I create a material array with the size of 3 in my ParticleRenderer , and set element0-2 to different materials … all 3 materials are used on each particle. This means each particle that is created gives me the 3 overlapping textures.
anyone knows what is going on … what did I forget to set on/off?
My previous suggestion was not correct. The different materials do actually get overdrawn at each particle’s position. Another approach to the problem is just to have several separate particle systems with different materials at the same position in space. As long as they are otherwise identical, you will get the same effect as you would from a single system emitting different particles.