Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question Big performance spike when first rendering a loaded scene

Discussion in 'High Definition Render Pipeline' started by FOXAcemond, Nov 12, 2020.

  1. FOXAcemond

    FOXAcemond

    Joined:
    Jan 23, 2015
    Posts:
    99
    Hello,

    In my game I'm loading two scenes with the Async method, making sure all operations have isDone to true before starting the game.

    The problem is when I first go to the second scene (teleportation), the first frame takes longer to render (sometimes 3s in the editor!) But afterwards performances are good (solid stable 60+FPS).

    The thing is, this does not occur when I go there for the second time. Actually the problem doesn't occur again unless I relaunch Unity or the build of the game. What is going on?

    Profiler for first render of the second scene:
    switch1.png
    Same run, second render of the second scene:
    switch2.png

    When going in the second scene, nothing particular happens, the camera, audio listener are moved and one directional light is turned off and the other one turned on. No fancy setting on those.