Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 3D options to rotation, velocity and angular velocity in ParticlesMaterial #3951

Open
lentsius-bark opened this issue Feb 11, 2022 · 8 comments

Comments

@lentsius-bark
Copy link

lentsius-bark commented Feb 11, 2022

Describe the project you are working on

3d roguelite called Cardbob revival, with heavy usage of particles that are using custom meshes as well as base godot primitives.

As a studio we're on a schedule to get to our MVP, the high level issue is that we know we could learn particle shaders, but other tasks are taking priority. The ParticlesMaterial has potential it isn't tapping into, which has lead to us giving up on some of the effects we had planned.

Describe the problem or limitation you are having in your project

The ParticlesMaterial at the moment feels as if it was originally created for 2d particles and ported over to 3d, with mainly 2d functionality, limiting its base usefulness.

  • The particle system does not provide a way to scale the mesh on any other axis apart from all three at the same time
    • the main limitations of not providing scale along any of the axis is that if the user creates a mesh that is a cylinder and wants to use that mesh in 5 different effects which all require that the cylinder be a different length means that the user would have to create 5 separate meshes, unless they wrote a shader.
  • The particle system does not allow to freely define rotation of the mesh as an emitted particle
    • similarly to the point above, imagine 5 visual effects which all require the mesh to be rotated in a different direction, when the particle is not billboarded

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

add the following options to scale and rotation(angle)
- Scale
- 3d scale checkbox
- - when on, enable setting the vector 3
- - when on, enable setting scale curve for each axis
edit: found out this is already done in godot 4. not yet ported to godot 3. this was done by implement curve3texture

  • Rotation (would be renamed from angle)
  • 3d rotation checkbox
    • when on, enable setting the vector 3
    • when on, enable setting rotation curve for each axis

additionally
the following properties may also benefit from exposed 3d options

  • damping (slow down along x but not y nor z)
  • angular velocity (apply angular velocity along z but not x nor y)
  • velocity (apply separate values for the velocity in the xyz directions)

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

as shown above

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

It is onto my understanding that this is completely feasible if one writes a particle shader.

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

The userbase of the 3d features is steadily growing and allowing users to tweak the scale and rotation of spawned meshes would enable the users of the engine to create much better looking effects without having to learn either particle shaders or particle visual shaders.

Benefits of implementing this in core:

  • easier to achieve higher quality effects
  • reusability of assets (one mesh useable for a variety of effects where only its dimensions require a change)

examples of plausible effects with the addition of the proposed features:

  • confetti
  • rotating spirals
  • bullet casings flying out of a gun
  • simulating objects falling down the cliff in the background with enough realism to trigger the suspension of disbelief

I believe that exposing these properties, will allow users to create beautiful effects, without having to resort to learning particle shader code or visual shader nodes.

@lentsius-bark lentsius-bark changed the title Add 3d scale and rotation options to the particle system Add 3d scale and rotation options to ParticlesMaterial Feb 11, 2022
@Calinou
Copy link
Member

Calinou commented Feb 11, 2022

The particle system does not provide a way to scale the mesh on any other axis apart from all three at the same time

I remember this being added in master by @QbieShay using Curve3Texture, or was I mistaken? See #2404.

@QbieShay
Copy link

Yup, you can do 3D scale with 3D curves ^^

@QbieShay
Copy link

I think we could actually benefit from adding a 3D curve for 3D velocity. Sometimes damping really doesn't do the job. It's hard to control.

@Calinou
Copy link
Member

Calinou commented Feb 11, 2022

I think we could actually benefit from adding a 3D curve for 3D velocity. Sometimes damping really doesn't do the job. It's hard to control.

There was an issue opened about this a while ago. In that issue, OP posted an improved damping formula that works well in most cases without requiring a custom curve. We have a lot of curve properties in ParticlesMaterial already, and usability might suffer if we add too many – so I'd prefer a simpler solution that suits most use cases.

@lentsius-bark
Copy link
Author

That is great news! Will this also work for 3D rotation? Also I take it that this is Godot 4 only?

@Calinou
Copy link
Member

Calinou commented Feb 12, 2022

Also I take it that this is Godot 4 only?

Yes, as Curve3Texture wasn't backported to 3.x yet (and neither were the ParticlesMaterial changes).

@lentsius-bark lentsius-bark changed the title Add 3d scale and rotation options to ParticlesMaterial Add 3d options to rotation, velocity and angular velocity in ParticlesMaterial Feb 13, 2022
@lentsius-bark
Copy link
Author

I've updated the title and proposal body to reflect the current state, also added in velocity as mentioned by @QbieShay which I agree would be fantastic.

@Calinou Calinou changed the title Add 3d options to rotation, velocity and angular velocity in ParticlesMaterial Add 3D options to rotation, velocity and angular velocity in ParticlesMaterial Sep 9, 2022
@QbieShay
Copy link

The particle rework should already have the velocity on an axis ^^ do you mind testing 4.2 and letting me know which one of those are still necessary? I am sure the rotation around axis is not done (for technical reasons, trying to find a solution there)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants