Search Issue Tracker
By Design
Votes
0
Found in
2023.1.0b8
2023.2.0a6
Issue ID
UUM-31225
Regression
No
GameObject Material is not rendered when building an asset bundle containing the Material with URP shader
How to reproduce:
1. Open the “AssetBundleBugRepro.zip“ project
1.1 Erase the Libray folder
2. Open “Window > Bug Repro Editor Window” from the menu bar
3. In the “Target Object“ ObjectField select the “Cube“ Prefab
4. Press ”Build to Bundle” on the “Bug Repo Editor Window“
5. Press ”Load and Instantiate” on the “Bug Repo Editor Window“
6. Select “cube.unity3d“ in the StreamingAssets folder
7. Observe the “Cube(Clone)“ GameObject
Expected result: The “Cube(Clone)“ GameObject has a gray Texture
Actual result: The “Cube(Clone)“ GameObject is pink
Reproducible with: 2023.1.0b8, 2023.2.0a6
Could not test with: 2020.3.46f1, 2021.3.21f1, 2022.2.11f1 (Could not compile shader variants)
Reproducible on: Windows 10
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Unity CIL Linker fails on Player build when persistent listeners have "<" and ">" in their XML attribute names
- ”Lighting data asset ‘LightingData’ is incompatible with the current Unity version…” warnings are thrown when saving Indoors (URP) and Outdoors (URP) Scenes as Scene Templates
- [iOS] The screen blinks when transitioning from custom to Unity splash screen
- [macOS] ”Ignoring depth surface load action as it is memoryless” warnings are thrown when taking Game View Snapshot
- UI Builder Inspector scrolls back up when changes on an expanded but not fully displayed Inspector tab are saved
Resolution Note:
Having the URP/lit shader in the Graphics Always Include category forces Unity to calculate all shader variants. For a player build this takes ages, and for the AssetBundle build there is a failure "Lit has too many Shader variants (20054016)." The recommended solution is to follow the recommendation in the error message to remove the shader from the always include list. When done the AssetBundle build can selectively compile just the variants that are needed and succeed. When done the cube is grey instead of pink in the provided project.