[URP] UberPost included in build even if no prostprocessing

Hello,

The postprocessing shader is included in the build even if no postprocessing is done in the scene.
Can be tested with the sample URP scene, by removing the post processing volume.
Using unity 2019.3.01f

Thanks!

Yes, I have also realized this. Maybe you could make an issue for it as well so that it can be tracked?

Ok. Submitted.

What is the issue number. Can you link to it?

1 Like

I’ve also reported this previously Stripping unused Universal render pipeline shaders and textures on iOS build haven’t had any feedback on my bug reports though.
And it’s not only the UberPost shader, there are also a bunch of built in textures related to post processing effects (like film grain etc) that are included in the build even though there’s no post processing.

I have the same issue. There are also a lot of FilmGrain texture that take up space in the build.
All that in a fresh 2019.3 project without any scenes or other files.

1 Like

Still looking for the issue number

The bug I reported on this in October 2019 was closed in fogbugz when I checked now, but I can’t seen any explanation why. I can’t find it in the issue tracker either (though that might be because it’s so hard to find things there). Perhaps they couldn’t reproduce the problem and never made an issue of the bug report. I’ve contacted them again asking them to reopen the bug and investigate it as it’s clearly still a problem.

5 Likes

Also, I see that in my Android build, post process add the dirt lens textures ( even if I removed them from post processing settings ). This texture is 22mb size. 1/3 of my game size.

I am also seeing this issue. Unity 2018.4.19f

Edit:
As a workaround I used the Package Manager to uninstall PPv2, and did my build. It works but complicates doing a build.

I tought that was normal, and the Uber shader is kinda huge. lols

Back on this. They closed the ticket and said that it’s normal for the shader to be included in the package and there is nothing they can do.
Could you guys please also submit a ticket ?

Any update on this?

The main offenders I’m seeing:
4.6 mb 1.0% Packages/com.unity.render-pipelines.universal/Shaders/PostProcessing/UberPost.shader
262.6 kb 0.1% Packages/com.unity.render-pipelines.universal/Textures/SMAA/AreaTex.tga
256.1 kb 0.1% Packages/com.unity.render-pipelines.universal/Textures/FilmGrain/Thin02.png
256.1 kb 0.1% Packages/com.unity.render-pipelines.universal/Textures/FilmGrain/Thin01.png
256.1 kb 0.1% Packages/com.unity.render-pipelines.universal/Textures/FilmGrain/Medium06.png
256.1 kb 0.1% Packages/com.unity.render-pipelines.universal/Textures/FilmGrain/Medium05.png
256.1 kb 0.1% Packages/com.unity.render-pipelines.universal/Textures/FilmGrain/Medium04.png
256.1 kb 0.1% Packages/com.unity.render-pipelines.universal/Textures/FilmGrain/Medium03.png
256.1 kb 0.1% Packages/com.unity.render-pipelines.universal/Textures/FilmGrain/Medium02.png
256.1 kb 0.1% Packages/com.unity.render-pipelines.universal/Textures/FilmGrain/Medium01.png
256.1 kb 0.1% Packages/com.unity.render-pipelines.universal/Textures/FilmGrain/Large02.png
256.1 kb 0.1% Packages/com.unity.render-pipelines.universal/Textures/FilmGrain/Large01.png
62.5 kb 0.0% Packages/com.unity.render-pipelines.universal/Shaders/PostProcessing/FinalPost.shader
60.0 kb 0.0% Packages/com.unity.render-pipelines.universal/Shaders/PostProcessing/BokehDepthOfField.shader
46.1 kb 0.0% Packages/com.unity.render-pipelines.universal/Shaders/PostProcessing/Bloom.shader
38.7 kb 0.0% Packages/com.unity.render-pipelines.universal/Shaders/PostProcessing/GaussianDepthOfField.shader
37.5 kb 0.0% Packages/com.unity.render-pipelines.universal/Shaders/PostProcessing/SubpixelMorphologicalAntialiasing.shader
37.1 kb 0.0% Packages/com.unity.render-pipelines.universal/Shaders/PostProcessing/LutBuilderHdr.shader
24.1 kb 0.0% Packages/com.unity.render-pipelines.universal/Shaders/PostProcessing/CameraMotionBlur.shader
17.9 kb 0.0% Packages/com.unity.render-pipelines.universal/Shaders/Particles/ParticlesUnlit.shader
17.8 kb 0.0% Packages/com.unity.render-pipelines.universal/Shaders/PostProcessing/LutBuilderLdr.shader
13.2 kb 0.0% Packages/com.unity.render-pipelines.universal/Shaders/Utils/CopyDepth.shader
11.5 kb 0.0% Packages/com.unity.render-pipelines.universal/Shaders/Utils/ScreenSpaceShadows.shader
11.0 kb 0.0% Packages/com.unity.render-pipelines.universal/Shaders/PostProcessing/PaniniProjection.shader
10.0 kb 0.0% Packages/com.unity.render-pipelines.universal/Shaders/Utils/Blit.shader
8.1 kb 0.0% Packages/com.unity.render-pipelines.universal/Shaders/Utils/Sampling.shader
7.7 kb 0.0% Packages/com.unity.render-pipelines.universal/Shaders/PostProcessing/StopNaN.shader
4.5 kb 0.0% Packages/com.unity.render-pipelines.universal/Shaders/Utils/FallbackError.shader

I’m definitely not using a lot of those postprocessing effects listed, I can understand that some are probably needed for dependencies, but this is a bit silly to add several MB to a project just for using URP.

1 Like

Hello, user @grapefrukt made a nice script that strips all of these before build, you can check it out here

We will add the option to strip disable (and then strip) post-processing from build.

5 Likes

That’s great news @phil_lira . For future reference, when this is added could you add a reply here explaining where this setting can be found so we can all use it?

3 Likes

Heads up.
I’ve made a PR to address this issue, currently in review, which should get backported to the 8 and 7 branches.

2 Likes

What are the odds of this making it into 2019.4 LTS?

This is something we really want to add to the LTS release so this will hopefully arrive in 7.5 along with other fixes. I can’t fully say when we’ll release that package but once we do I will try my best to include it.

2 Likes

Is this in 2019.4 LTS?

How I can strip all post-processing shaders and related assets from Unity builds using URP?