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

Godot 4 Beta 10 big FPS drops Linux Ubuntu #70530

Open
CHIESOFTWARE opened this issue Dec 24, 2022 · 14 comments
Open

Godot 4 Beta 10 big FPS drops Linux Ubuntu #70530

CHIESOFTWARE opened this issue Dec 24, 2022 · 14 comments

Comments

@CHIESOFTWARE
Copy link

CHIESOFTWARE commented Dec 24, 2022

min test.zip

Godot version

4.0 beta 10

System information

Ubuntu Studio 22.04, 12x Intel I5 10500H 2.50GHz 4gb envidia 1650 max Q

Issue description

I have a project done in Godot 4.0 beta 8 that goes perfectly well, it has almost no code yet, only the necessary for debugging. I just opened the project in Godot 4.0 beta 9 and beta 10 and in both the project suffers a drop in FPS from 60 to 10.

I did nothing more than open the project and hit play.

godot_issue

Steps to reproduce

In my case I only have to open the project made in Godot 4.0 beta 8 in godot beta 9 or 10.

Minimal reproduction project

min test.zip

@Calinou
Copy link
Member

Calinou commented Dec 24, 2022

@CHIESOFTWARE Please upload a minimal reproduction project to make this easier to troubleshoot.

@CHIESOFTWARE
Copy link
Author

CHIESOFTWARE commented Dec 24, 2022

@Calinou I am currently adding and removing scenes to see which one is causing problems. If I remove some scenes and leave the basics the FPS remains stable. Apparently something in some scene must be causing the bug which doesn't happen with beta 8.

@CHIESOFTWARE
Copy link
Author

CHIESOFTWARE commented Dec 24, 2022

@Calinou Can you send me an email or something to share you my project so you can help me to find what is causing this bug?

Just to clarify, I'm not trying to get you to fix my project, just that since the bug is in my entire project I'd like to pass you everything I've done to see if that helps you find the bug in Godot. But as it is something that I don't want to share publicly I would like you to send it to me in a more private way.

@Calinou
Copy link
Member

Calinou commented Dec 24, 2022

Can you send me an email or something to share you my project so you can help me to find what is causing this bug?

We don't have time to inspect full projects individually, so I'm afraid I can't provide that.

@CHIESOFTWARE
Copy link
Author

CHIESOFTWARE commented Dec 24, 2022

@Calinou I don't want you to inspect my project, I just want you to use it as a test project to find the error.

@CHIESOFTWARE
Copy link
Author

I found some lines of code in charge of verifying the distance of the player and based on the distance change the material of the object in question. There are at least 600 of these objects, they are only checked if the player is close, i.e. all 600 are never checked at the same time or all of them.

These 10 lines of code did not give me problems in the previous beta and now they do, I am working to create a test project for you to see what causes this bug.

@Zireael07
Copy link
Contributor

@CHIESOFTWARE Regardless of how you phrase it, Godot 4 is supposed to release before March. To hit that target, contributors need to focus on finishing the last features, not "use your full project to find the error". That's why you're asked to give a MRP - the smallest project you can make which has the bug

@CHIESOFTWARE
Copy link
Author

@Zireael07 @Calinou I understand, I'm trying to get an alpha of the project for that date. I have already uploaded the test project, certain conditions are needed for the error to occur.

In the past the code you will see there did not cause any problem, now in beta 9 and 10 the process increases the milliseconds up to more than 2000ms. I don't know what changes you have made in that aspect, but it seems that there is a bottleneck when processing many objects.

@stmSi
Copy link
Contributor

stmSi commented Dec 25, 2022

@CHIESOFTWARE this is not an engine issue.
Flamegraph shows that you use a lot of "material_override" 99% of time... setting material override is very expensive process.

image

try to minimize the material_override usage (avoid using it every frame or avoid using it with Timer every 0.5sec timeout)

image

I got ~55fps after i insert "return" statement at the start of function like _check_lods _cerrar_puerta_por_distancia _check_lods_room

@CHIESOFTWARE
Copy link
Author

@stmSi Hi, Ok I understand, but why does it cause this problem only in beta 9 and 10 and not in beta 8? If that's all it should fail in all beta. I am not an expert in this area, obviously.

@stmSi
Copy link
Contributor

stmSi commented Dec 26, 2022

i didn't have the debug build for beta 8, i will check it after i build it

@CHIESOFTWARE
Copy link
Author

By the way, in the process of looking for what was causing the problem, I changed the rendering to mobile-compatible rendering and noticed that the distance fade of the lights does not work well at all.

@Calinou
Copy link
Member

Calinou commented Dec 26, 2022

I changed the rendering to mobile-compatible rendering and noticed that the distance fade of the lights does not work well at all.

Distance fade is broken if you use any lights with projectors in the scene: #67845

@CHIESOFTWARE
Copy link
Author

CHIESOFTWARE commented Dec 26, 2022

I am using omnilights, and a directional light. Luckily it works well in high quality rendering.

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

No branches or pull requests

5 participants