Why do shaders take up 21% of the overall build?

Hi,

I use only a handful of mobile shaders in my game. However the build report shows over 21mb of shaders included in the build! Where do they come from and is it possible to reduce this number?

Build Report

Uncompressed usage by category:

Textures 26.4 mb 54.8%

Meshes 1.2 mb 2.6%

Animations 11.0 kb 0.0%

Sounds 638.4 kb 1.3%

Shaders 12.1 mb 25.1% <<< HUGE!!!

Other Assets 2.1 mb 4.4%

Levels 0.3 mb 0.6%

Scripts 1.2 mb 2.4%

Included DLLs 3.9 mb 8.2%

File headers 329.8 kb 0.7%

Complete size 48.2 mb 100.0%

https://aras-p.info/blog/2015/01/14/optimizing-shader-info-loading/

Looks like this was/is a bug? What version are you running?

Shaders typically are small, but depending on the amount of work done, a shader may have a different implementation for every system unity supports. What are your shader file sizes? I still find it hard to imagine 12 megs of shaders though. Can you share what shaders you are using?

Also, you could try putting the shaders in another project, attaching a simple material/object in a scene to each, build, then remove each shader 1 by 1 to see which is taking the most space. Depending on where/how you got the shader, you could probably talk to the developer of it for advice, or find a different shader.

I found it - the Broadleaf_Mobile from Standard Assets drags along with it 9Mb worth of shaders, textures and materials into the build. Not very “mobile”, considering you are ideally trying to fit your game into a 100mb package.