Search Unity

WebGL rendering 10x slower than editor (culprit appears to be RenderDiffered.CopyDepth)

Discussion in 'Web' started by travlake, Jun 24, 2020.

  1. travlake

    travlake

    Joined:
    Oct 4, 2019
    Posts:
    50
    My game takes around 10x longer to render at high resolutions in a WebGL build (running locally or on server is no different). Using the Profiler, I get the following in-editor:

    in_editor.png

    Note all the rendering takes less than 7ms.

    When built to WebGL and run on the same machine with the same resolution (4k), I get:

    in_webgl_build.png

    The player loop rendering the same scene takes 80+ms, with most of the extra time concentrated in RenderDiffered.CopyDepth, whatever that is.

    Any thoughts on what this means or where to go from here?

    In case it's a useful diagnostic, the scene runs at 40fps in WebGL and 50fps in editor when at 1080p. So the dropoff between editor & WebGL is only at high resolutions.

    Im using Unity 2019.3.7f1