Download

Possible to have particle sizes that a certain aspect ration like 2:1 and still be randomly scaled?

Hi!

Is it possible to have particles that are rectangular but are still randomly sized?

Example

  • I want a particle flame to be 1:2 so its twice as high as its wide.
  • I want to scale their size, however I want to keep their aspect ratio
  • I want to also scale them over lifetime so they are large in the beginning of their life time and then get smaller.

This is a feature that I have used for years in other engines, but simply cannot figure out how to do it in Unreal.
Cheers!
/Andreas

One way to do it is with vertex deformation in the material.

In the material subtract the “Absolute World Position” from the “Particle Position” and multiply it with a dynamic parameter. Feed that into “World Position Offset”.
In the particle system set the aspect ratio via “Initial Size” or “Size by Life” or a combination of the two and add a dynamic parameter module. Set the param to “Spawn Time Only” and the distribution to uniform and give it whatever range of size multiplier you need.

Drawback is that it will only work with cpu particles. Depending on your particular case you might be able to use Particle Direction, World Position, Speed, Time or anything like that to get around the limitation that dynamic parameters don’t work with gpu particles. Another approach to get it to work with GPU particles would be to use blueprint to feed the random value through to the particles.

Hope this helps.

Thanks Divi. Thanks for the tips, all good thoughts!

Some comments

  • only CPU makes it of course quite a bit less useful, try to use GPU for almost everything
  • Blueprints are very slow and only run one one cpu core so you wouldn’t want to feed random values when you have many.

Yea I think for this case will will change the particle code so that x and y use the same random value instead of independent one, that way the aspect ratio will always be the same.

But thanks for the tips!
/Andreas