Search Unity

  1. Looking for a job or to hire someone for a project? Check out the re-opened job forums.
    Dismiss Notice
  2. Unity 2020 LTS & Unity 2021.1 have been released.
    Dismiss Notice
  3. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

URP adds 1.4MB to the (compressed) wasm code size

Discussion in 'WebGL' started by jfaust-fy, Feb 24, 2021.

  1. jfaust-fy

    jfaust-fy

    Joined:
    Dec 2, 2020
    Posts:
    5
    I'm doing some tests to figure out how small a package I can get to as a starting point for a web-based project. One of the things I've run into is a major difference in the generated wasm size for URP vs. the builtin render pipeline - seemingly having nothing to do with URP at all. To do this test I:
    1. Created a new 3D project with a cube and a camera (no collider on the cube)
    2. Set engine stripping to high
    3. Made a Release wasm build (shown below as builtin-renderpipe.wasm.br
    4. Installed URP (https://docs.unity3d.com/Packages/c...ersal@10.3/manual/InstallURPIntoAProject.html)
    5. Made another build (urp.wasm.br below)


    1576198 Feb 23 18:09 builtin-renderpipe.wasm.br



    2949806 Feb 23 18:12 urp.wasm.br


    Looking at the builds with the BuildReportInspector, I see:
    Builtin:
    builtin.png
    URP:
    urp.png

    There are a few differences, but the main thing I notice is the inclusion of the Physics and Physics2D modules, even though they're not being used.

    Has anyone else seen this? Is there something in URP that forces Physics to be included? Is there any way for me to force it to be stripped?

    Thanks
     
    De-Panther likes this.
  2. jukka_j

    jukka_j

    Unity Technologies

    Joined:
    May 4, 2018
    Posts:
    633
    Discussing this with the Universal Render Pipeline team, the reason for this physics dependency is due to volumetric rendering features support, where the renderer needs to do physics queries to reason about the visibility and overlap of different Volume objects. There is unfortunately no current way to strip out this dependency, but this is a known issue in the URP team, and they do have plans to add support for stripping out the volume system from the renderer altogether.
     
  3. jfaust-fy

    jfaust-fy

    Joined:
    Dec 2, 2020
    Posts:
    5
    That makes sense - I guess I'll be sticking to the builtin pipeline for now. Thanks!
     
unityunity