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

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:

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:


URP:

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

1 Like

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.

4 Likes

That makes sense - I guess I’ll be sticking to the builtin pipeline for now. Thanks!