-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Limit mesh complexity in LOD generation to prevent crashing #80467
Conversation
I guess for such kind of meshes the better could be mesh streaming as it designed for that. |
I'm confused: The check is happening after the LOD was generated. If Shouldn't this be checking the index count before calling into SurfaceTool? |
I am also a little worried that this crash is VRAM amount dependent. The limit is likely different depending on your hardware |
The GPU used in #80431 has 8 GB of VRAM, so this will affect most users in this case. Even if you happen to have a GPU with more than 8 GB of VRAM, it's not guaranteed that everyone working on your project will also have a GPU with more than 8 GB of VRAM. |
What feedback is required? Do we need to send 6 million triangle scenes and see what happens? |
I don't know what people prefer as the optimal solution, but not crashing is better than crashing. So if it's up to me, I would merge this to fix the immediate issue, and it can be improved later. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed during #animation / #asset-pipeline meeting. This is a workaround/hack to "fix" the issue until we actually find the issue. Only happens when you have a single mesh of ~200Mb.
7a847eb
to
f95f2d1
Compare
Thanks! |
Cherry-picked for 4.1.3. |
This PR fixes the crash in #80431. Instead of crashing, Godot will now print this message:
I set the limit to
5000000
(5 million). I'm not certain what the limit should be, but a limit of 6 million crashes.Note: I suspect that there is a bug in the LOD generator and that the limit should be higher than this. However, even if the limit should be higher, it's still good to have some kind of limit that prints a meaningful message instead of crashing. Also, this mesh lags Godot, so LODs are not the only problem with a mesh this big.