Particle emitter physics?

I was playing around with unity and particle emitters, and found something really useful which would be very nce to have - particle physics! This would allow single particles to collide with objects, allowing effects such as sparks and debris. While I’m at it, it would also be cool if the lighting could affect the hue of the particles.

14 Likes

I don’t think it’s feasible to have full-fledged physics for the particles, but I’d like to be able to at the least specify planes with which I want the particles to interact.

I think lighting-affected particles is already on the list of features they want to implement eventually.

Why is that? Is it particularly resource intensive?

I can imagine it’s cheaper to perform physics on a point-based particle opposed to an actual part colliding with the environment, especially also because it should all be on the client and does not need to be synchronized between clients. However, if you have hundreds of particles on your screen that could possibly collide with the environment, I doubt that won’t reduce performance significantly.

Furthermore, how do you define hitboxes for particles? Particles are point-based objects right now, and they rotate around that single point. But instead of a point, a particle would rather need to have a sphere-based hitbox, otherwise its texture will go half-way through the environment whenever it collides. And naturally a sphere hitbox means a higher performance impact, since computing collisions is more resource intensive for spheres opposed to points.

They could raycast the direction the particle is moving, that could work. Since it is a point anyway.

Don’t you already do raycsting for physics?

I think OP wants collisions with dynamic environments as well, and as soon as your environment is dynamic (i.e. can change through moving parts) then simply raycasting in the direction of the point won’t work any more. Also if the angle between the direction of movement and the surface of an object is low enough, the texture will still clip through the environment for a significant part.

I think point-based collisions would still be an okay solution to this, although still resource intensive and you’ll also have the texture clipping issue I display in the image. Another negative aspect about point-based particles is that they have the potential to (theoretically) creep into infinitely small creases between objects which may cause unexpected results.

Then don’t make 100 collidable particle emitters? Particles can have a CollisionsEnabled/CanCollide property – not all of them need to calculate collisions.

I don’t know what number of particles is feasible to begin with, it would basically mean colliding a bunch of little spheres with the environment.

Besides, will full-fledged physics be that useful for particles? I think you would want the particles to interact with certain surfaces but not all of them. (e.g. sparks from an electricity cable would interact with the floor and walls but not with the character as I walk under it) I think manually specifying which objects should be interacted with, or specifying the collision surfaces yourself, would allow for a larger amount of colliding particles and would also fulfil most of the use cases I can think of.

Here’s some spiffy particle collisions from unreal engine

a bit much?

No way!

26 Likes

Cool! It seems point-based so that explains why it’s feasible I suppose.

Lots of interesting things to see in the video, for example in that first collision one part of the particles seems to get gravity and the other just continues on without gravity (meaning properties per face of the objects?! or the gravity is just super low and I can’t tell that the left stream has gravity), and the red hollow cylinder seems to have different properties as well because the particles have enough energy to get all the way out again. :open_mouth:

1 Like

Nah, there’s no physics in that project, everything’s purely kinematic. Hackweek.

The gravity is localized (vector field), can also be spherical and push in both directions. The cylinder is a custom pipe-like effector. Deflectors merely reverse the normal velocity with some relative-speed hacks built in, so that you can e.g. flick the particles with a fast-moving deflector attached to a part.

Fake gravity

9 Likes

8 Likes

Even if it’s fake, it still works and looks very good… I doubt many particles will need accurate physics either. This was what? 10 years ago? Come on, We need this. As of now, there are a few particle physics modules in #resources, and even those were a few years ago. Why can’t Roblox add this into particles by default?

2 Likes