Frame Time looks like a sawtooth function

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By leo-pnt

Hi !

My game runs fine and I have 60 fps constant on desktop.

On android, I think the game takes way more resources than it should. I mean, the phone is getting too hot and the notification center becomes super laggy. And this even happens from the gui where nothing special happens (It’s not doing this on other games). Also the phone is not that bad (xiaomi mi 9t) so something is going on.

In the profiler, the Frame Time and Idle Time both look like a sawtooth function that oscilates between 10ms and 25ms. And there are a lot of very fast ups and downs in this range. Is it normal ?

Also, I use SceneTree.STRETCH_MODE_2D to adapt on every screen so the resolution goes from 1024x600 to 2340x1080 on the smartphone. Maybe it is the source problem on mobile ?

EDIT:
I added a setting in my game to max fps at 30 and set strech mode to viewport, and by some magical way the game runs super smooth now on mobile even with or without this setting.
There is now more sawtooth oscillations in the frame time
I really don’t understand what happend. The only other things I remember having changed are some values of this shader (Actually I think it was the issue) GitHub - henriquelalves/SimpleGodotCRTShader: A simple Godot shader that simulates CRT Displays (scansize and line distance) and I disabled oversampling in Rendering > quality > Dynamic Font
Oh yes ! Also I enabled Fallback to Gles2 in Rendering > quality > shader.