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

High fps and periodic lags

Discussion in 'Editor & General Support' started by the_gnoblin, Dec 19, 2009.

  1. the_gnoblin

    the_gnoblin

    Joined:
    Jan 10, 2009
    Posts:
    722
    I have an "intro scene", where camera and several texture planes are being animated (camera moves to the right, layered planes move to the left with different speed) to tell the story (so the player knows what's going on in a game). The problem is that without using VBL i see periodic lags (every half a second or so)... I run it on a powerful machine and FPS is high.

    What am I possibly doing wrong and what can I do to fix the problem?

    Thanks.
     
  2. the_gnoblin

    the_gnoblin

    Joined:
    Jan 10, 2009
    Posts:
    722
    Profiler shows that a spike on CPU load happens in "Loading.ReadObject()" - what's that? :)
     
  3. the_gnoblin

    the_gnoblin

    Joined:
    Jan 10, 2009
    Posts:
    722
    profiler screenshot
     

    Attached Files:

  4. KarelVR

    KarelVR

    Joined:
    Oct 12, 2005
    Posts:
    51
    I just bought Pro at last, checked my game in the profiler (since I noticed some fps drops too), and I have the same problem. A huge spike on Loading.ReadObject.

    In my case it seems at moments where I have to load an additional textures.

    Any ideas what causes the problem, and what could be done (or avoided) to fix a lagspike like this ?

    Cheers !
     
  5. the_gnoblin

    the_gnoblin

    Joined:
    Jan 10, 2009
    Posts:
    722
    I forgot to post a solution to the problem . :eek:
    It seems that ReadObject happens when a texture first appears on the screen and must be loaded into video memory.

    I've used an old trick: hidden all textures in my scene on small planes so they can't be seen by the player (but can, technically, be seen by the camera), when the scene is loaded - so they are all loaded into video memory at the beginning... Sorry for the poor explanation of the trick (there are lots of posts about it - so you may find a much better one) :).
     
  6. KarelVR

    KarelVR

    Joined:
    Oct 12, 2005
    Posts:
    51
    Thanks for the update !

    Did some forum searching about the issue, so I can start trying some possible solutions out.

    Thanks ! ;)
     
  7. frogsbo

    frogsbo

    Joined:
    Jan 16, 2014
    Posts:
    79
    loading mesh into the graphics card also causes massive lag. if i have a procedural mesh with 60k verts that updates every second, the FPS is high and the game is very laggy. if there is a way to improve that it would be great.