Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
ImmersiveMatthew's avatar
4 years ago

Inconsistent FPS Hiccups only on first run

SOLVED:  You all will not believe the issue especially since I could find any mention of this anywhere. It was the skyboxes. I had skyboxes in many scenes (due to duplicating some of them during their creation) and while they do not change the sky in the Player or on the Quest when you async load the scene (which I am really unsure why) they must still have an impact in the load process, especially for heavier scenes that are already pushing the Quest. To fix, I "Set Active Scene" for each scene and then deleted it's skybox as I already set them elsewhere with code in strategic spots in my title. Once I did that all went back to perfect 72FPS without a single hiccup.  

 

This explains why creating a new scene and copying the contents of an offending scene fixed the issue as a new scene has the default skybox which is a much lighter skybox than my others ones. This is also why when I created that fresh scene another scene would start acting up as the 2 scene shared the same skybox and hence when I fix one, the next one after is now the first to load that skybox in memory.  No wonder I felt like I was playing Whack-A-Mole!  GOSH...this was a hard one to detect. I spent many hours pouring over the various anlysis tools and performing untold trial and error builds, but the problem was very evasive especially since you never see the sky change.  I cannot believe it was the Skybox for all these months. I encourage you to even delete the default skybox on a new async scene as even they have a small impact. I hope this solution helps others and prevents them from stalling their development. 

 

Original Post:

I am stumped and hope others here can provide some insights. Simply, if you install my title and then run it, you may notice a handful of small FPS Hiccups. That said, the second and all subsequent runs will NOT have any FPS Hiccups. If you reboot your Quest after install then run it, you will also NOT have any FPS hiccups. Why? I used the Profiler and RenderDoc and all I see is the same elements in these scenarios, with that first run after install taking longer to load scenes. There is no obvious reason I can detect as to why.


I preload all my shaders when the app runs and I am async/additive loading scenes constantly which is what is causing the FPS hiccups during that first run after install. I really do not know where to look next. If you wish to see for yourself, it is in App Lab. This issue sucks as most would run immediately after install.

 

Thanks for any tips/insights

9 Replies

Replies have been turned off for this discussion
    • ImmersiveMatthew's avatar
      ImmersiveMatthew
      Adventurer

      Thank you so much. I missed this in this months Dev Blog somehow.  At a glance it looks like it has a few tips I have not explored yet so I am feeling hopeful that I can perhaps eliminate the last few FPS issues on initial run.  

    • ImmersiveMatthew's avatar
      ImmersiveMatthew
      Adventurer

      I think the one nugget in this blog post is ReadWrite enabled on game objects.  ALL of my game objects have ReadWrite enabled.  AHAHA.  It was nessesary for the Bakery, but is easy to turn off and on (albiet it takes time) so I am going to give this a try in my next build.  I will report back.

      • baroquedub's avatar
        baroquedub
        MVP

        Yeah, please do let us know. Always good to know these things about the more obtuse Unity settings. Sometimes feels a bit like a juggling act using that engine. Just one tick box and the whole performance pyramid comes tumbling down 🙂

         

  • FIXED!!!! I finally fixed the FPS hiccups and it was not at all what I would have expected. The profiler was giving me a clue about a LogToConsole taking a very long time. I always assumed it was just a side effect and that the root cause was elsewhere as there was literally nothing written to the Console of Editor Log. Today though after 8 hours of messing with it all, I decided to turn off the stack trace which I noticed was on. That was it...all issues are gone and it runs butter smooth. Just to be sure, I turned it back on to full logging and the FPS hiccups returned. Oh well, glad I solved it.

     

     
     

  • Thanks for sharing that. I'd always heard Debug.Log messages were had on performance but never realised just how much. Great to hear you've got things sorted.

  • SOLVED:  You all will not believe the issue especially since I could find any mention of this anywhere. It was the skyboxes. I had skyboxes in many scenes (due to duplicating some of them during their creation) and while they do not change the sky in the Player or on the Quest when you async load the scene (which I am really unsure why) they must still have an impact in the load process, especially for heavier scenes that are already pushing the Quest. To fix, I "Set Active Scene" for each scene and then deleted it's skybox as I already set them elsewhere with code in strategic spots in my title. Once I did that all went back to perfect 72FPS without a single hiccup.  

     

    This explains why creating a new scene and copying the contents of an offending scene fixed the issue as a new scene has the default skybox which is a much lighter skybox than my others ones. This is also why when I created that fresh scene another scene would start acting up as the 2 scene shared the same skybox and hence when I fix one, the next one after is now the first to load that skybox in memory.  No wonder I felt like I was playing Whack-A-Mole!  GOSH...this was a hard one to detect. I spent many hours pouring over the various anlysis tools and performing untold trial and error builds, but the problem was very evasive especially since you never see the sky change.  I cannot believe it was the Skybox for all these months. I encourage you to even delete the default skybox on a new async scene as even they have a small impact. I hope this solution helps others and prevents

  • Again, very much appreciate you taking the time to let others know about your findings.
    When you say "copying the contents of an offending scene fixed the issue as a new scene has the default skybox which is a much lighter skybox than my others ones", can you clarify what the difference was between the default skybox material (which uses Unity's Skybox/Procedural shader) and your own skybox material. Where you using Cubemap, or a custom shader?

    • ImmersiveMatthew's avatar
      ImmersiveMatthew
      Adventurer

      Yes, my skyboxes are more detailed and use a cube map.  I did read that Unity’s sky boxes are not very efficient for the Quest which now I have solved the above, they seem to be fine, but my next step is to find out what others are using for their sky today boxes when you need clouds and such.  What do you use may I ask? 

      thanks for the positive feed. I just hope to help others avoid the massive time I have wasted on this issue.  We need more successful devs making VR titles for the Quest.  Like a lot more.