Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

WebGL: Huge Spikes In Profiler With Completely Blank Project/Scene

Discussion in 'WebGL' started by ISlandFace, Apr 22, 2015.

  1. ISlandFace

    ISlandFace

    Joined:
    Feb 18, 2013
    Posts:
    9
    Hi Everyone,

    After chrome dropped webplayer support, I began trying to get my game working in WebGL. I've been tearing it apart trying to figure out why it is stuttering in Firefox 37.0.1(not tested on other browsers) on a 2010 MBP. Every 0.5 - 1.5 seconds the profiler shows a huge spike (200-400ms!) under Camera.Render - Drawing - Render.OpaqueGeometry - Clear.

    I removed everything from the scene and still see that spike. I then made a new project, created a blank scene with only a camera (solid color clear flags) and a directional light... same spikes except its under Camera.Render - Drawing - Render.OpaqueGeometry - RenderForwardOpaque.Render - Clear.

    I'm not sure what to do from here, is anyone else getting the same results?

    Blank scene profiler screenshot:
    Screen Shot 2015-04-21 at 10.42.09 PM.png
     
    Last edited: Apr 22, 2015
  2. ISlandFace

    ISlandFace

    Joined:
    Feb 18, 2013
    Posts:
    9
    Bump
     
    Last edited: Apr 24, 2015
  3. Simon_says

    Simon_says

    Joined:
    Oct 19, 2013
    Posts:
    141
  4. ISlandFace

    ISlandFace

    Joined:
    Feb 18, 2013
    Posts:
    9
    Has anyone else experienced this and is there a solution?
     
  5. vincentellis

    vincentellis

    Joined:
    Oct 21, 2013
    Posts:
    100
    I'm experiencing this as well.
     
  6. cheesemaster

    cheesemaster

    Joined:
    Sep 4, 2012
    Posts:
    38
    I've confirmed this in the end browsers with an empty scene and simple framerate calculator script which allows you to define a "spike" in terms of short framerate drops and count them up:

    Interestingly, there are large differences between the latest firefox and chrome on WebGL:
    (using 2gz intel, 2gb ram laptop)

    Chrome : average FPS = 40.66,
    Over the course of 5 minutes FPS fluctuates between 20.76 and 47.91, reaching below 30.00 on 5 different occasions.

    Firefox : average FPS = 33.95,
    Over the course of 5 minutes FPS fluctuates between 13.55 and 36.58, reaching below 20.00 on 5 different occasions

    Spikes are just as frequent on the Web Player but are possibly less noticeable as framerate is much better:
    Web Player : average FPS = 59.50
    Over the course of 5 minutes FPS fluctuates between 29.92 and 60.20, reaching below 50.0 on 6 different occasions.

    Spikes seem more numerous at the beginning as things are initializing, and seem to stable out after the first 5 minutes on all platforms. Hope this can help people gage what they can expect from WebGL before investing a lot of time on it - the "near native speeds" quote that gets thrown about doesn't seem to apply to our slightly older machines anyway.
     
  7. ISlandFace

    ISlandFace

    Joined:
    Feb 18, 2013
    Posts:
    9
    Thanks for your answer but the average framerate isn't necessarily the problem I'm experiencing. My game runs fine at 20fps so I have the target fps set at 20 but since these "spikes" can take up to 400ms to complete, even on an empty scene, there's a stuttering/pause in the gameplay, every second or less, causing the game to be unplayable.