Hi
I use multiple cinemachine cameras, but only one at a time is enabled, and get random frame drops, and after analysing the “build and run” it seems the cpu is processing 11 ms on cinemachine per frame !
I could not understand the profiler output, any suggestions would be much appreciated
I am on Unity 2022.3.7 and Cinemachine 2.9.7 and main camera is freelook that has these framedrops. Also there is an overlay camera for UI that runs separately from Cinemachine brain, with regular Unity Camera set, could that be the issue ? If so what is the correct way ?
What happens if you remove all cinemachine components from your scene? PostLateUpdate.FinishFrameRendering is a URP call not cinemachine.
What’s your draw call looks like? You could see that in the stats window of the game view (A screen shot would help if you can).
Also could you save the profiling data (Top right of the profiler window) and send it to us?
What happens if you remove all cinemachine components from your scene? PostLateUpdate.FinishFrameRendering is a URP call not cinemachine.
No cameras are rendering and the frames seem good. Also it is an URP call but the child calls (RenderSingleCameraInternal etc ) are referencing the Cinemachine ?
What’s your draw call looks like? You could see that in the stats window of the game view (A screen shot would help if you can). Also could you save the profiling data (Top right of the profiler window) and send it to us?
Tried attaching it, same as image but the file extension is not supported ? Where should I email it to ?
Now the question how do you fix that? You might need some trial and errors to find what’s wrong.
From what I have seen it’s not your meshes. 100k triangles and 250 batches is a very low value.
Thank you!
I previously had regular cameras with a camera stack of an overlay camera for rendering UI particle system.
Now:
The main camera I turned it into a CinemachineBrain, without removing the stack ? Would this interaction of regular cameras with Cinemachine could cause such unwanted frame drops ? It shows a warning. If I remove it where should I stack it ? As my new main Cinemachine camera is - Freelook, but it does not have an option to stack? Also I switch between other virtual cameras occasionally, but this particle system needs to be constantly available, regardless of Cinemachine camera status.
(Also there is separate UI Canvas with Screen Space Overlay, but I would assume it does not have any effect on this)
Can you show us the full inspector of the image you posted? To be completelly honnest I don’t know how stacks works would help me reproduce your issue.
So initially I had a camera stack on my main camera which I turned into a CinemachineBrain and then a warning showed on the stack field and it offered a fix which I selected. Now a regular camera, not a Cinemachine camera is set as overlay and stacked on CinemachineBrain, is that fine ? Or does the stacked camera has to be from Cinemachine package ?
I compared the profiler with and without camera stacked and there is a performance hit, and the smoothness of the camera does feel not as good if without the stack ?
Cinemachine is only a system to procedurally animate the camera’s transform and some of its lens properties. It does not impose any restrictions on the camera system or on how you can combine the Cinemachine-animated cameras with other cameras. Think of it as a complicated script to animate an object.
Does the overhead occur if you disable the CM brain?
Also important when testing framerate and smoothness in Unity: do it in a build, not in the editor. Editor introduces lots of spurious overhead. And if you MUST do it in the editor, minimize the number of open views and make sure no inspector is visible.
Yes the profiler images I added above are from development build with autoconnect profiler on a device. Cinemachine is taking 30 % of player loop, and when the camera stack is used it seems the smoothness of camera is affected, I do not understand the profiler much and so am confused. sorry
I think I provided render thread instead of main and there still is similar overhead as CM, I dont know then, there is a massive Gfx : Semaphore.Waitforsignal which means the graphics is waiting for other thread to finish, but how do I find which ?