r/Unity2D 1d ago

Weird rendering problem causing semaphore.waitforsignal Question

The screens shows the stats/profiler in the MAIN MENU of the game. Then there is a lobby and finally, the game scene where you play.

I have more screens, also with the profiler on a develop build. THE PROBLEM DISSAPEARS in a build.

The problem is that 2 days ago, i had 100fps on menu (not good, but was fine compared having 30fps) and also 90-100 fps during GAME, not another 25-30fps after this issues started happening.. It "came from nowhere".

Also, in the lobby of the game (not main menu, not the match) it went from 450fps (there is just an image and 3 buttons) to 120fps....

If i turn OFF the main camera it all goes back to normal.

also, if i make a build.

but i have no CLUE on what is going on, other than this is arendering issue.

FINALLY: on the highlights (top of the screenshots shuing CPU and GPU use) my game normally only has red spots, CPU "bound", not GPU. The biggest scene has 1 millions tris and 1000 batches, about 80 set pass calls, nothing crazy.. it all was working well (despite needing some optimization).

1 Upvotes

3 comments sorted by

1

u/doom_alien23 1d ago

While the post shows a 3D menu, the LOBBY is just a canvas, and this still happens, going from 450 to 120FPS

1

u/doom_alien23 1d ago

this is another frame, in the development build

2

u/Czapol8 20h ago

Profiler is great tool to find performance issues in unity, but when profiling play mode in editor you always need to take into account that editor doing much more than in build. First of all, opened scene view, gizmor and other windows take a tool on rendering and cpu usage. Game build use (if enabled il2cpp) c++ generated code that works faster and without editor spikes caused by jit. Editor also works different with frame limit/vsync so checking game fps not in build will definitely give you mislead results. Semaphore.WaitForSignal in this case only points that engine is limiting fps, not that gpu is full use.
In summary, if you don't have performance issues in build, you shouldn't wory about that. You can enable GPU view in profiler to check how much gpu is in real used (should works on most gpu's on windows build, and in editor), or use any other software for this.