Upload particle system to nme


Modify the built-in case in the particle system on nme, an error occurred during file upload.
I think it should be a closed loop

The .json must contain the definition of a single particle system. In your screenshot, the .json files contain several systems and are not suitable for the preview window.

I see,thanks

another question

In this particle system I try to scale down it, I haven’t found a good way yet

 const test = BABYLON.ParticleHelper.CreateAsync("explosion", scene).then((set) => {
                set.systems.forEach(s => {
                    s.disposeOnStop = true;

                    // s.minScaleX = 0.01
                    // s.maxScaleX = 0.05

                    // s.minScaleY = 0.02
                    // s.maxScaleY = 0.04
                });
                set.start();
            });

            // test.minScaleX = 0.01
            // test.minScaleX = 0.01
            // test.maxScaleX = 0.05

            // test.minScaleY = 0.02
            // test.maxScaleY = 0.04

I don’t think there’s a simple property for that. You will have to scale down some properties of the particle system (speed, size, emission rate, …).

cc @PatrickRyan in case he has some tips about it.

1 Like

@lvjing1111122 what @Evgeni_Popov said is correct, there is no single property to “scale” a particle system. This is because we don’t actually have bounds as a parameter of the system. The size in units that a system covers has more to do with emission power, lifetime, velocity gradients, velocity limit gradients, and drag gradients. Even things like particle color can affect the perception of how much area the system covers as you could change the color of an additive particle to black halfway through its life and the perceived “size” of the particle system would be cut in half. So there are too many controls over the particle system to effectively “scale” the whole thing.

It’s easier to think of a particle system as a simulation without a volume. Every change to a parameter affecting the speed, life, or color of a particle can change the overall shape of the system. When changing these parameters that change the overall shape of the system, you will also likely need to scale the individual particle sizes. The minScale and maxScale parameters you show in your code above are tied to each individual particle. This is how you would scale the particle quads themselves, but to shape the area the particle system covers, start first with lifetime and emission power as they will be the two basic levers. If you are making an explosion, you will also need some sort of drag or velocity gradient. When you add that, you will need to rebalance emission power to compensate. This is the approach I always use.

I hope this helps, but if you have specific questions about the parameters, feel free to ping back or start a new thread.

1 Like