SixWays / UnityShaderStripper

Modular utilities for shader stripping to drastically improve Unity build times
MIT License
351 stars 42 forks source link

AB shader stripping kind of work, but not really #8

Open turbojoys-cyberjoys opened 3 years ago

turbojoys-cyberjoys commented 3 years ago

hi, i tried the tool and it sort of work, wondering if there is anything can be done to improve the issue

so, the set up is typical model prefab AB, where FBX imported in unity with/without ImportMaterial set to true(which will leave the default material in-link with the imported mesh), then make a material using a in-project shader, and assign to the model renderer, then make it a prefab, and mark as AB output. then i tried build this AB with and without your tool active, the following is the result AB compare in size

Comp_AB_Stripping

the one on the left is built with your tool active(which was set to strip out Resource/built_in), the right is built without your tool active. the standard shader in the left one really got deminished(suggested by the size), but if you look closely, all the mesh in the one on the left are now bigger that the one on the right, and ultimately, making the one with shader stripping done, is slightly bigger than the one that has no shader stripping, due to the mesh size increase.

yeah, the tool does work and deminished the standard shader to the minimum, but somehow (i have no clue why) this leads to all the mesh in the AB got increase in size, which really beating the purpose of stripping the shader from indi AB in the first place.

really hope you hav the time to look into this, cheers mate