Search Issue Tracker
By Design
Votes
0
Found in
5.3.2p2
Issue ID
772030
Regression
No
[Asset Bundles][Shaders] When building bundles from a closed scene more shaders get stripped
To reproduce:
1. Extract the project ("repro.zip")
2. Go to the Client/Bundles folder and delete its contents.
3. Open attached project
4. Set the platform to iOS.
5. Open the scene "TestScene"
6. From the BugRepro menu click Assets -> Build iPhone
7. Go back to the Client/Bundles folder in Finder. Note the size of the marmoset_shader_mobile bundle. On my machine it's ~500KB.
8. Delete the contents of the Client/Bundles folder.
9. Close Unity.
10. Invoke the asset bundle build script from command line as follows (replacing the paths to point to the correct Unity app and project):
/Applications/Unity/Unity.app/Contents/MacOS/Unity -projectPath /Users/jc/src/projectName/Client5 -buildTarget iOS -quit -batchmode -executeMethod AssetBundler.BuildAssetBundlesiPhone
11. Go back to the Client/Bundles folder in Finder. Notice the size of the marmoset_shader_mobile bundle is significantly smaller than previously. On my machine, it's ~120 KB.
Also reproducible in the Editor if no scene is open, or if another scene is open.
Workaround: Turn on Manual Shader Stripping. To do so open the scene you would like to calculate the Lightmap modes from and in the Graphics Settings inspector (Edit/Project Settings/Graphics) select Manual under Shader stripping/Lightmap modes. Then select 'From current scene'.
Action: Update the Manual for Building Asset Bundles to include information about Shader Stripping. Also create a new Feature Request case to investigate best way to allow Shader Stripping from "other assets" too i.e. Inspector fields or API to be able to include materials/objects to look into.
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Texture2D hash changes inside of an AssetBundle when rebuilding a SpriteAtlas bundle with an empty AssetPostprocessor Script enabled
- Aniso Level still applies when Generate MipMap is disabled in Texture Import Settings
- Mipmap Limit Groups long names are not truncated when creating a new Mipmap Limit Group with a long name
- “ArgumentException: Invalid double parameter.” error is thrown when Infinity is typed into the Fixed Timestep field
- GameObject becomes gray when using HDRP and STP together on macOS
Add comment