Skip to content

Particle velocity/direction enhancements #6657

@QbieShay

Description

@QbieShay

Describe the project you are working on

Various VFX! I am a VFX artist! Professionally! WHEEEE

Describe the problem or limitation you are having in your project

The way velocity is treated in Godot does not allow me to reliably realize my creative vision with VFX.
It lacks fine control both on the magnitude of it and the direction.

This proposal proposes 2 enchancements:

  1. Velocity over life curve
  2. Velocity direction options

NOTE: Acceleration produces by definition an "ease out" motion. There's no way to have ease-in curve or linear motion when using acceleration. That's why it should be decoupled from direction.

Attractors don't do it either because their usecase is basically interacting with the world. They use a very physical approach. This is good for more realistic particles and for interacting with the game world, but it's not what I'm disucssing in this proposal. Furthermore, attractors are not local to a single particle system, so I can't have two nearby particle systems not be affected by each other's attractors.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

Velocity over life

Expose a curve for velocity over life. If the curve is exposed, all accelerations will stop working: I don't see a way to make them meaningfully work together.
This exposes an underlying issue in particles: the acceleration right now does not only control acceleration. It controls as well direction of the particles. There's currently no way to have particles orienting in interesting ways without using acceleration (radial, tangent, etc.). An outlier there is turbulence. Together with @RPicster we worked on making turbulence act mostly on the direction of the particle rather than any other property (it slows down particles when they make a sharp turn, which we figured out with testing, looks way better and more natural)

Velocity directions

Introduce a new concept for velocity direction and ways to control it. This can be done in various steps, a good step by step is the following:

  1. Velocity from point: all particles consistently orient away from the point
  2. Cylinder orbital: all particles orbit around a cylinder
  3. Sphere orbital: all particles orbit on the surface of a sphere

Note for Cylinder and Sphere that the surface that they move on should be defined by the particle position when the cylinder/sphere orbital affects it, so there shouldn't be any explicit radius property. The properties for the sphere should be something to control the direction in a meaningful way and the properties for the cylinder should just be the axis and clockwise/counterclockwise motion property.

Also please don't tell me to go use tangent + radial to make orbiting particles. It's super fiddly and still it doesn't achieve the result i want.

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

Velocity over life

Expose a single curve that takes the velocity generated at start() and multiplies it by the curve.

Velocity directions

Add a "Direction constraints" category, with the following options:

  1. None
  2. From point
  3. Turbulence
  4. Cylindrical
  5. Spherical

When this is enabled, they would all expose a constrain_over_life property, that is a curve from 0 to 1, to define how to align velocity in the same way that turbulence does.

From point

  • position(vec3)(default 0,0,0): the position that the particles should face away/to
  • away(bool)(default true): face towards or away from the point?
  • local_space(bool)(default true): is this position to be interpreted world space or local space
    image

Turbulence

  • We already have it, no need to change it, just to group it under this category -

Cylindrical

  • axis(vec3)(default 0,1,0): the axis of the cylinder
  • clockwise(bool)(default true): clockwise/counterclockwise motion. not entirely necessary because it should be enough to flip the axis, but it's nicer to work with.
    image

Spherical

I don't think there's any necessary property. I am not sure this is even needed. It's a cylinder but with no axis, so each particle picks an axis and goes.
image

If this enhancement will not be used often, can it be worked around with a few lines of script?

Yes it can. But it means losing the particle process material and using a shader, with all the documented hassles of this process.
It also means losing compatibility with CPUParticles, which is something that people never want in a professional environment.

Is there a reason why this should be core and not an add-on in the asset library?

I can script this myself using visual shaders/shaders but i can't script cpuparticles. I would lose compat with CPUParticles. This is a long running issues when customizing particles, and the reason why particle shaders are not taking off, in my opinion. People care about

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Done

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions