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 a crash when Sprite3D.extra_cull_margin is positive and then assign a texture to it #81069

Conversation

jsjtxietian
Copy link
Contributor

@jsjtxietian jsjtxietian commented Aug 28, 2023

This pr fixes #80749.
It works in my test but I'm no familiar with the code logic so I'm not sure whether this change will break other things.

The bug's root cause can be found in the issue conversation. Basically what I do is to rebuild the bvh when p_instance's base_type change from INSTANCE_NONE to any INSTANCE_GEOMETRY. Maybe there is a better way to fix this issue, thank you for your suggestions in advance.

@jsjtxietian jsjtxietian requested a review from a team as a code owner August 28, 2023 11:34
@jsjtxietian jsjtxietian marked this pull request as draft August 28, 2023 11:34
@AThousandShips AThousandShips added this to the 4.x milestone Aug 28, 2023
@jsjtxietian jsjtxietian force-pushed the fix-crash-when-Sprite3D.extra_cull_margin-positive-then-assign branch from 54d0bdc to 574e053 Compare August 28, 2023 11:48
@jsjtxietian jsjtxietian marked this pull request as ready for review August 28, 2023 11:48
@jsjtxietian jsjtxietian marked this pull request as draft August 28, 2023 11:49
@jsjtxietian jsjtxietian force-pushed the fix-crash-when-Sprite3D.extra_cull_margin-positive-then-assign branch from 574e053 to 75c85a3 Compare August 28, 2023 11:50
@jsjtxietian jsjtxietian force-pushed the fix-crash-when-Sprite3D.extra_cull_margin-positive-then-assign branch from 75c85a3 to 129f85c Compare August 28, 2023 11:53
@jsjtxietian jsjtxietian marked this pull request as ready for review August 28, 2023 11:53
@akien-mga akien-mga changed the title Fix a crash when Sprite3D.extra_cull_margin is positive and then assign a texture to it Fix a crash when Sprite3D.extra_cull_margin is positive and then assign a texture to it Nov 9, 2023
@AThousandShips
Copy link
Member

@jsjtxietian
Copy link
Contributor Author

I haven't update this pr for a long time, probably need some re-thinking on the fix now ( back then I had little experience of Godot ).

@jsjtxietian
Copy link
Contributor Author

Superseded by #95503

@jsjtxietian jsjtxietian deleted the fix-crash-when-Sprite3D.extra_cull_margin-positive-then-assign branch August 14, 2024 02:28
@akien-mga akien-mga removed this from the 4.4 milestone Aug 14, 2024
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.

Silent crash when Sprite3D.texture is assigned while null and Sprite3D.extra_cull_margin is positive
5 participants