Search Issue Tracker
By Design
Votes
0
Found in
2023.1.0a18
Issue ID
UUM-18936
Regression
Yes
Color is ignored when changing Sprite Renderer color using “SetColor”
How to reproduce:
1. Open the user’s attached project
2. Enter Play Mode and observe the sprites
Expected result: Sprites have a white border around them
Actual result: Sprites have a red border around them
Reproducible with: 2023.1.0a11, 2023.1.0a18
Not reproducible with: 2021.3.13f1, 2022.1.22f1, 2022.2.0b15, 2023.1.0a10
Could not test with: 2020.3.4f1 (Errors after project downgrade)
Reproduced on: macOS 12.4 (Intel)
Note: Reproducible in the Editor and in the Standalone Player
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
- Out-of-bounds memory access with multiple CanvasRenderers under a Canvas when using Mesh API
- Inspector tries to access file after it was deleted when the file was locked in Inspector window
- Changing Transform values in Search window Inspector loses focus while dragging and stopping mouse without releasing dragging action
- Saving changes on the dirty VFX Graph during the Play mode throws "The referenced script (Unknown) on this Behaviour is missing!" warnings
- VFX Graph Debug Info overlaps the "Initialize" block debug info by default
Resolution Note:
The user project uses a few custom shaders (including Amplify Shader Editor & Allin1ShaderEditor).
Colors for Sprite-Renderers is traditionally done through Vertex Colors so they can dynamically batch even though colors are not same.
_RendererColor is a special case property only used/applicable for Instancing and for all other cases is White.
Since 2023.1 2D Renderers support SRP-Batcher and _RendererColor has been removed.
float2 uv_MainTex = IN . texCoord0 . xy * _MainTex_ST . xy + _MainTex_ST . zw ;
float4 Color = tex2Dbias ( _MainTex , float4 ( uv_MainTex , 0 , - 0.4 ) ) ;
//#line 310
Color = IN . color * *_RendererColor ;
return Color ;
}
For 23.1, please use unity_SpriteColor for Color property. This will also ensure that they can dynamically batch. Thanks.