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

Fix sqrt application for radius in particle ring emission #91449

Merged

Conversation

Arnklit
Copy link
Contributor

@Arnklit Arnklit commented May 2, 2024

This is a follow up to #91223.

I did not apply the sqrt correctly in that PR. The radius control is broken.

I also failed to realise that the even distribution for a circle shape becomes more and more like a cylindrical strip the closer the inner radius get's to the outer radius. I think the best solution for this is to lerp between the two distributions.

The inner radius could also be above the the outer radius before, it is now clamped by the outer radius to avoid unexpected behaviour.

godot.windows.editor.dev.x86_64_JydpEjwWOD.mp4

Note if this not merged before 4.3, then #91223 has to be reverted.

@Arnklit Arnklit requested a review from a team as a code owner May 2, 2024 09:35
@AThousandShips AThousandShips added this to the 4.3 milestone May 2, 2024
@AThousandShips AThousandShips requested a review from a team May 2, 2024 09:37
@akien-mga akien-mga requested review from a team and removed request for a team May 2, 2024 09:46
@Arnklit Arnklit marked this pull request as draft May 14, 2024 10:43
@Arnklit Arnklit force-pushed the particles-emission-ring-shape-fix2 branch from 925672c to e2c3a8b Compare May 14, 2024 11:04
@Arnklit
Copy link
Contributor Author

Arnklit commented May 14, 2024

OK, fixed as @kleonc suggested. Thanks for that. I think I panicked a bit with me making the regression in the first place and couldn't figure out the right way to resolve it.
I left the ability to have the inner radius go above the outer as it just starts acting as the outer radius now, which seems ok.

@Arnklit Arnklit marked this pull request as ready for review May 14, 2024 11:06
@kleonc
Copy link
Member

kleonc commented May 14, 2024

@Arnklit Note you haven't updated cpu_particles_3d.cpp in your new commit (or rather there's a leftover in there). 🙃

@Arnklit Arnklit force-pushed the particles-emission-ring-shape-fix2 branch from e2c3a8b to 94eefe1 Compare May 14, 2024 11:22
@Arnklit
Copy link
Contributor Author

Arnklit commented May 14, 2024

@kleonc just shoot me. Fixed now.

Copy link
Member

@kleonc kleonc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haven't tested but calculations look good. 👍

@akien-mga akien-mga merged commit de32955 into godotengine:master May 14, 2024
16 checks passed
@akien-mga
Copy link
Member

Thanks!

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

Successfully merging this pull request may close these issues.

4 participants