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

Box Emission Shape for GPU and CPU particles is double the size it should be. #90891

Closed
Arnklit opened this issue Apr 19, 2024 · 5 comments · Fixed by #90967
Closed

Box Emission Shape for GPU and CPU particles is double the size it should be. #90891

Arnklit opened this issue Apr 19, 2024 · 5 comments · Fixed by #90967

Comments

@Arnklit
Copy link
Contributor

Arnklit commented Apr 19, 2024

Tested versions

4.2.2.stable

System information

Godot v4.2.2.stable - Windows 10.0.22631 - Vulkan (Forward+) - dedicated AMD Radeon RX 7800 XT (Advanced Micro Devices, Inc.; 31.0.24019.1006) - AMD Ryzen 9 7900X 12-Core Processor (24 Threads)

Issue description

The box emission shape is twice the expected area.

image
These three all have extends of 1,1,1.

This is easy to fix in the particle processing, but I don't know if we need to wait until a major release where we are breaking back compat since it will mess up people's existing particle setups.

Steps to reproduce

Create a particle system and set it to box emission and observe the size of the emission area.

Minimal reproduction project (MRP)

particles_box_emission_issue.zip

@and-rad
Copy link
Contributor

and-rad commented Apr 19, 2024

You will notice that the property of the CollisionShape3D element is called "size", not "extents". Extents describes a shape's "half size", so what you're seeing is expected and not a bug. It's just something to get used to, you'll find the same in other engines, too.

@Arnklit
Copy link
Contributor Author

Arnklit commented Apr 19, 2024

Ah couldn't find that when I first looked at this because I was unsure if it was on purpose. Thanks @and-rad . We might wanna note it here. https://docs.godotengine.org/en/stable/classes/class_particleprocessmaterial.html#class-particleprocessmaterial-property-emission-box-extents

Found this example explaining it for another engine as well.
upload_2021-4-3_12-10-24

@clayjohn
Copy link
Member

This is sad to see. Before 4.0 we did a pass to try to move everything to "size" instead of "extents" as the difference was confusing a lot of people #72075

But I guess we missed this one. I think a note in the documentation would be helpful

@clayjohn clayjohn added this to the 4.x milestone Apr 19, 2024
@and-rad
Copy link
Contributor

and-rad commented Apr 19, 2024

Did you miss it or did you maybe keep it on purpose because it might have performance implications? I'm just thinking, since it's used in the particles material, storing the information as extents rather than size might make some computations with regards to bounds and overlaps easier?

@Calinou
Copy link
Member

Calinou commented Apr 22, 2024

This is sad to see. Before 4.0 we did a pass to try to move everything to "size" instead of "extents" as the difference was confusing a lot of people #72075

We can likely migrate this one without breaking compatibility by adding a new emission_box_size property, deprecating the old one, hiding it from the editor and using _set() to assign it to the new property automatically.

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

Successfully merging a pull request may close this issue.

6 participants