Hey,
We’re busy developing a VR application for the Meta Quest 2.
So we recently upgraded a project of ours to Unity 2022.3.2f1 URP + Android from Unity 2021.3 URP + Android.
We have a scene that passed QA a while back and had no issues in Unity 2021.
But after we upgraded this specific scene started crashing out of the blue.
After disabling game objects, we’ve narrowed it down exactly to the Camera that is outputting to a Render Texture, and confirmed it by only disabling that Camera and then no crashes occur.
As soon as we enable the Camera it continues playing for about 20 seconds and then the application crashes.
Looking at the performance logs of the Quest 2, the FPS drops from 72FPS down to 42FPS.
The CPU usually running at 60%-70% is not maxing out at 100% just before it crashes.
The headset then throws a “Not enough memory to run application” error.
I get the feeling that there’s a memory leak on the Camera output to the render texture, but I have no idea how to address it.
There is no code involved.
It’s just placing the camera in scene, and connecting the render texture as output.
The Render Texture is then used on a URP/Unlit material.
The Camera:
I’ve also tried setting the culling mask to a layer only containing the 2 meshes that it would ever be able to see.
1x 2D Unity Plane (512 texture)
1x 80Poly Sphere (2048 texture)
There is no Skybox, so I’ve also tried setting that to be a solid color.
The Render Texture:
I’ve tried setting Depth Stencil Format to None as well.
It didn’t make a difference.
Also tried dropping the resolution down to 128 x 128, also didn’t make a difference.
The Material:
This was working fine in Unity 2021.3.x URP.
We haven’t made any changes to this scene.
I will test in a empty blank Unity scene, and upload the results here as well.
EDIT 1:
Tested in a blank Unity Scene with only the XR Rig.
The application still crashes after about 20 seconds, same settings as above.
EDIT 2:
Replicated the issue in a brand new Unity 2022.3.2f1 URP + Android application.
Install Oculus Integration and applied recommended settings.
Added a Camera and Render Texture to the scene, built, and got the exact same issue.