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
- Texture Import Warnings are obscured by other Terrain Layer options in the Inspector
- Burst Inspector middle divider is jittering when resized with the Burst Inspector window docked
- JsonConvert conversion fails trying to call GetCallbackMethodsForType when [OnDeserialized] is used in a class
- Different text alignment in the column header in Entities "System" window
- Objects with Universal Render Pipeline/Particles/Lit shader are always lit up when changing their Rendering Layer Mask
Add comment