Search Issue Tracker
By Design
Votes
0
Found in
2017.4
2019.3.2f1
2020.2
Issue ID
1223405
Regression
No
UI Image element's diffuse texture is not updated when shaders are switched
How to reproduce:
1. Open user's 'UI Default Shader Texture.zip' attached project
2. Open 'SampleScene' Scene
3. Select 'Material' material in Project Browser
4. Change UI/Default shader to Standard shader in the Inspector
5. Change the Albedo texture map to 'Green' texture
6. Change shader from Standard to UI/Default shader
Expected result: 'Image' GameObject is red in the Scene View and GameView
Actual result: 'Image' GameObject is green in the Scene View and GameView
Reproducible with: 2017.4.38f1, 2019.4.19f1, 2019.3.6f1, 2020.1.0b2, 2020.2.0a3
Notes:
- Video of reproduction attached in Edit
- _MainTex property is properly updated when using primitive meshes
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
- Scene Filter buttons reset to "All" in the Occlusion Window when entering Play Mode but the Scene Filters themselves do not reset
- Transition property is not disabled in the UI Builder when it is set by a variable
- Crash on PersistentManager::GetSerializedType when opening a specific Scene
- GlobalObjectId.GetGlobalObjectIdSlow returns empty ID when in Prefab Isolation Mode
- Crash on Transform::RemoveFromParent when deleting a child GameObject
Resolution Note (2020.2.X):
This is how the image component works. by default the UI uses a sprites texture as its _MainTex. If there is no sprite it falls back to the assigned materials mainTexture. If there is no material assigned or not texture on that material it falls back to a white texture.
The reason its not shown in the inspector is the property on the shader is a PerRendererData type so its not something thats assigned in the asset.
As for why it doesnt update until its in play mode, while thats just a inherient issue inside of Unity. We have no way of tracking (without causing large editor performance issues) when a material has changed to force the element to rebuild its rendering. As the UI is built into a single mesh with the batcher unless we know we need to rebuild the batch it will keep drawing what it already has.