Why Does Culling Still Consume CPU Time When a Camera Is Not Actually Rendering?
Why does Culling still consume CPU time when a Camera is not actually involved in rendering the final image?
As long as a remains enabled, it may continue to perform rendering preparation work such as Culling , even if the current frame does not actually need to display its content. In the GameOptim GOT Online report, the number of calls remains around 10 . Further investigation shows that although the scene contains multiple Cameras, some Cameras that are not currently needed have not been disabled. At the same time, Culling accounts for approximately 40% of the rendering module's time. https://uwa overseas public.oss us east 1.aliyuncs.com/uploads/markdown/a0d8a649 ea7f 4c81 8ed5 fada32d7f36d.png Culling filters objects based on the Camera's view to determine which objects may participate in subsequent rendering. Therefore, not seeing a Camera's content in the final image does not mean that the Camera has no associated CPU cost. Features such as character previews, package displays, 3D UI, and RenderTexture can all create additional Cameras. If a UI is closed by simply hiding its content without also disabling the corresponding Camera, the associated overhead may remain. https://uwa overseas public.oss us east 1.aliyuncs.com/uploads/markdown/bedbbba8 a2f1 4e1d 971e a89315f3d21c.png The issue can be even more apparent in mini game projects. In some intervals of the report, the number of Cameras reaches around 40 , and rendering time also increases noticeably during those intervals. https://uwa overseas public.oss us east 1.aliyuncs.com/uploads/markdown/6960a350 adfe 4a59 83aa b12af5f761b6.png During investigation, focus on three areas: Compare the number of calls with the number of Cameras actually required by the current view. Check temporary Cameras used for UI, character previews, RenderTexture, and similar features. Confirm that these Cameras are disabled promptly after they are no longer needed. For Cameras that must remain enabled, check their . Determine whether the includes Layers that do not need to be processed. After making these changes, monitor the number of calls and Culling time again. If both decrease, this can help determine whether the additional Cameras were contributing to the observed CPU overhead.