Hi guys, i’m facing a strange problem with my current project.
I’m working on a custom viewer for stereoscopic cubemaps and I’m developing for Gear VR (S6).
The app is composed by 2 scenes, a light-weight “home” scene, with some lowpoly 3d elements and a minimal GUI, and a second scene, the real “viewer”.
In the second scene a custom script loads 10 cubemaps (5 for the left eye, 5 for the right) and displays themes using 2 skyboxes, swtiching between left/right in the onPreRender function.
So far so good. The system works, performance is great, ram loads seem manageable.
The problem arises when i load again the first scene; performance drops, and i get 15 FPS in the VERY SAME scene where i was making 60 FPS “until a load ago”!
The problem is there every time i load the first scene after the second; if i stay in the first scene, or if i swap between two “twin” home scenes, performances stay great.
This is the profiler on the Home scene, the first time:
This is the profiler on the second scene, the Viewer (notice the high ram usage for the cubemaps)
And this is the profiler when i load again the first scene. DISASTER! 99.9% of time waiting for frames:
I’m currently loading the scene with a basic SceneManager.LoadScene (), no Additive or dontDestroyOnLoad or other strange things. I’ve tried forcing the unload of unused assets with no luck.
I’m trying to follow the Unity / Oculus guidelines for VR as closely as possibile.
Am i doing something wrong? What should i check?
I’m quite new at programming in unity, expecially for VR. every bit of help will be greatly appreciated!
let me know if you need more info or other data.
thank you so much,
marco


