-
-
Notifications
You must be signed in to change notification settings - Fork 21.9k
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
Silent crash when Sprite3D.texture is assigned while null and Sprite3D.extra_cull_margin is positive #80749
Comments
Can you confirm it is a silent crash and just not showing in the editor? Open with console and check the console instead |
@AThousandShips 8FOBYvUCxD.webm |
Thank you! To have videos play in your comment make sure to put empty lines around it, I've fixed this for you but keep it in mind |
Stacktrace
|
Might be caused by an invalid AABB as it is empty if no texture was set, would be worth checking if the DynamicBVH breaks if provided empty AABB |
I think I might find where the bug is, but I'm not familiar to the bvh code logic so I might be wrong, feel free to correct me. After And after the assign( And in the code of |
@jsjtxietian That looks like it is likely the culprit. Do you why the Sprite3D is set to |
@clayjohn Sorry my previous explain is wrong to some extent, yesterday I found the bug has something to do with time and I missed that when using a debugger. If one comment out the code in timer and just step thorugh the code in
I think maybe when we change p_instance's base_type, we just clear and rebuild the bvh ? Take a look at my draft,your suggestions are welcomed. |
Godot version
v4.1.1.stable.official [bd6af8e] v4.0.3.stable.official [5222a99]
System information
Godot v4.1.1.stable - Windows 10.0.19044 - Vulkan (Forward+) - dedicated NVIDIA GeForce GTX 1660 SUPER (NVIDIA; 31.0.15.3168) - AMD Ryzen 5 5600G with Radeon Graphics (12 Threads)
Issue description
Under these circumstances a silent game crash will occur when running a scene while using the editor or in an exported release:
$Sprite3D.extra_cull_margin = 0.25
or any positive number.$Sprite3D.texture == null
.$Sprite3D.texture = preload("res://icon.svg")
, or any texture, but only if not in_ready()
.Unsure if related, but there is an alternative silent crash if
extra_cull_margin
is set to a large number like 100000000. However, it occurs the second time$Sprite3D.texture
is assigned tonull
of all things.When happening in my game, the crash was a bit weirder but I can't recreate it. It was instead randomly crashing over a period of minutes, after when the repro would have crashed. During that time, the Sprite3D would be correctly assigned a texture(checked via remote view and prints), but it would be invisible in game.
Notes:
$Sprite3D.custom_aabb
.$Sprite3D.extra_cull_margin = -1.0
will obviously error, so it doesn't crash.Steps to reproduce
Download and run
main.tscn
to see the crash occur.main.gd
contains commentary and example code.If you use an external console, you may see one more print compared to the editor's console upon crash.
Uncomment
$Sprite3D.extra_cull_margin = 100000000.0
inmain.gd
to see alternative crash.Minimal reproduction project
crash_reproduction.zip
The text was updated successfully, but these errors were encountered: