Why Can a Hidden Video Still Impact Game Performance in Unity?
A tutorial video only appears when players do not perform a specific action for 5 seconds. However, the GameOptim GOT Online report shows that the RenderTexture used for video playback remains resident, and VideoPlayer related functions also consume noticeable CPU time. Since the video is not displayed most of the time, why does it still affect performance?
A video not being visible does not mean that its related resources and runtime logic have stopped running. According to the GOT Online report, this tutorial video uses a full screen RenderTexture with a 32 bit color format and a 32 bit depth buffer. The RenderTexture remains resident throughout the entire test process. In other words, although the video only appears under specific conditions, the resources allocated for video playback continue to occupy memory when the video is not displayed. https://uwa overseas public.oss us east 1.aliyuncs.com/uploads/markdown/bacca2ff b219 4580 b72a ac53c3b7eae2.png For a short tutorial video that only appears occasionally, it is necessary to evaluate whether the current resource configuration is appropriate. Three questions should be considered: Is a full screen RenderTexture resolution actually required? Are the color and depth formats higher than necessary? Does this RenderTexture need to remain allocated throughout the entire gameplay session? https://uwa overseas public.oss us east 1.aliyuncs.com/uploads/markdown/7cc64325 edf3 4f49 99d8 85f8ed5c2fb6.png In addition to memory usage, VideoPlayer itself can introduce CPU overhead. The report shows that the average cost of VideoPlayer related functions is 1.47 ms , but this average value does not fully represent the actual impact. Looking only at frames where measurable costs occur, the single frame overhead can approach 3 ms . https://uwa overseas public.oss us east 1.aliyuncs.com/uploads/markdown/fdd40f30 78c6 4205 b774 937cc155c5bc.png For a game targeting 30 FPS , each frame has a time budget of approximately 33 ms . A nearly 3 ms CPU cost already takes up a noticeable portion of the frame budget, especially considering that the video content is not displayed most of the time. https://uwa overseas public.oss us east 1.aliyuncs.com/uploads/markdown/c9090e57 9b4f 46d8 8a4a e8eb64c419e7.png When investigating similar issues, developers should first verify two points: After the video is hidden, does VideoPlayer continue updating? Does the corresponding RenderTexture really need to remain resident? If the video is only used as a low frequency tutorial prompt, developers should reconsider whether video playback is necessary and whether the current resource specifications are higher than required. Optimizing resource lifetime and reducing unnecessary runtime processing can help avoid hidden performance costs.