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

2D Particle Emission Mask is offset #16411

Closed
PullTheStrings opened this issue Feb 5, 2018 · 3 comments · Fixed by #78944
Closed

2D Particle Emission Mask is offset #16411

PullTheStrings opened this issue Feb 5, 2018 · 3 comments · Fixed by #78944

Comments

@PullTheStrings
Copy link

Godot version:

3.0
OS/device including version:

Issue description:

When I load an Emission Mask for a 2DParticle system the result is offset since the mask is placed from the top left corner and not the center.
In the screenshots below the Emission Mask has been generated from the same image used for the Well sprite.
The offset might be the intended behavior or a limitation of the way the particle system works now I don't know. Placement from the center would seem to be the expected behavior however.

The first image shows the center of the Well sprite.
The second image shows the center of the 2DParticle system.

godotparticlemaskbug2

godotparticlemaskbug1

Steps to reproduce:
Place a 2D Sprite and a 2DParticle system at 0,0. Add an image to the sprite and load the same image as an Emission Mask in the 2DParticle system.

Minimal reproduction project:

@PullTheStrings PullTheStrings changed the title Particle Emission Mask is offset 2D Particle Emission Mask is offset Feb 5, 2018
@akien-mga
Copy link
Member

It's actually the Sprite which is offset, as you've enabled the "Centered" option. I guess Particles2D doesn't have it, like most other 2D nodes.

@PullTheStrings
Copy link
Author

Particles2D emit from the center of its node. The new Emission Mask options are great, it's just somewhat of an annoyance that the Emission Mask created from an image is anchored in the top left corner and not the center. Anchored in the center was the way Emission Masks behaved in Godot 2. So I advocate for the option to choose anchoring the Emission Mask in the center.

@chanon chanon mentioned this issue Aug 20, 2018
30 tasks
eligt added a commit to eligt/godot that referenced this issue Jul 17, 2019
The emission mask now uses relative values which are multiplied by the emission extents. This also fixes the issue where emission points are dependent on original texture size.

This commits also change emission points texture to be centered on the particle system instead of placing the top left corner at the center.

I think this also fixes godotengine#16411
Added CPU particles
@akien-mga akien-mga added this to the 4.0 milestone May 11, 2021
@QbieShay
Copy link
Contributor

QbieShay commented Feb 22, 2023

This should be fixed by adding an option "centered" on the generation side of the point texture.
Pushing to 4.1 since it's not a critical bug and can be worked around.

@YuriSizov YuriSizov added this to the 4.2 milestone Jul 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment