godotengine / godot-proposals

Godot Improvement Proposals (GIPs)
MIT License
1.16k stars 97 forks source link

Add cone emitter to particles #6761

Closed QbieShay closed 2 months ago

QbieShay commented 1 year ago

Describe the project you are working on

VFX

Describe the problem or limitation you are having in your project

There is no way to spawn particles in a cone

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

Add a cone emitter with properties for angle of the cone, length of the cone, flatness of the cone (imagine projecting the cone on a plane).

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

See above

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

Yes, I can script my own emitters. But using custom particle shaders has documented hassle (https://github.com/godotengine/godot-proposals/discussions/6661)

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

See https://github.com/godotengine/godot-proposals/discussions/6661

Calinou commented 1 year ago

Should particles be emitted on the cone surface or within the cone volume?

QbieShay commented 1 year ago

I suppose, both? I was thinking of the cone volume but both works

QbieShay commented 1 year ago

I'm thinking maybe it's enough to add a property to the ring emitter for this

Calinou commented 1 year ago

I'm thinking maybe it's enough to add a property to the ring emitter for this

Sounds good :slightly_smiling_face:

If the ring's top and bottom radius can be changed separately, then you can have a cone (top/bottom radius = 0.0) or anything in between. This would also allow choosing between whether the surface or volume should be used by adjusting the inner ring radius.

MewPurPur commented 1 year ago

CylinderMesh makes it so setting one of its caps to 0 radius turns it into a cone. For customization's sake and also for consistency, we probably want to implement cones the same way for particles.