Particles with randomised UVs

I’m trying to create a particle system that produces particles with randomised UV offsets.

Thus far I haven’t found a way to do so to my satisfaction with the standard particle system: I can create a system that has the same randomised UV offset for all particles created by that system, but not one in which each particle has a different UV offset.

I thought that I might sub-class one of the classes used in Panda’s particle systems… but which, and what method or methods within it or them should I override? My guess is the renderer, but I don’t see a method in the API that appears to deal with drawing or manipulating a particle, nor a means of getting a single particle.

Does anyone have any suggestions as to what I might do?

what about having different textures for each particle?
you need several similar textures to make the particles look like having random UV.

I have considered that, but it runs somewhat counter to what I’m attempting. Thank you for the suggestion, however! :slight_smile:

I’m not sure this is possible while still being efficient. From my own experiments, it seems the particle system contains a master object and just instances this out to each of the particles. If each one had a randomised Uv, Panda3d would need to keep a model for each particle, thereby invalidating any reason for using particles in the first place.

What exactly are you attempting to do? I can’t think of a particle that would require a random uv instead of a random selection from a small number of uv possibilities.

If you can get it to work with only 3-4 uv possibiltiies, you might try just having that many particle effects all parented to the same node. Each would be responsible for a fraction of the total particles, but each would have a different Uv map.

Hmm… I think that I suspected that something like that might be happening in the background…

Using a set of particle effects might work indeed – thank you for the idea.

As for what I’m doing, I’m attempting to find a particularly efficient approach to creating a “fire” effect. My little netbook – which I’m hoping to keep as my “minimal spec.” machine – seems to have trouble with too many particle systems being present at once.

So, one approach that I’m trying is using a particle effect that produces only a few particles at a time and attaching to that a repeating animated texture, the idea being that most of the impression of fire comes from the animation and the additive blending of one particle with the next – and indeed, the effect looks promising thus far – while allowing the fire to respond to being attached to a moving object as with a standard particle effect. However, with the UVs static, it’s far too obvious that it’s the same animation. I’m hoping that by offsetting the UVs that repetition will be far harder to spot.

(I’m using a second texture stage with a masking image to hide the edges of the animating texture, as I recall.)

(I’m also hoping to look into forcing a single system to emit in more than one place on a given update in the hopes that at least some of the trouble is in having many systems; I have a query on that attempt in another thread in this sub-forum, I believe.)

One way or another, thank you for the insight and suggestion! :slight_smile: