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
- Opening Terrain Prefab in Prefab Editing Mode throws "NullReferenceException" error
- [Search] Dragging query pills put them behind the search text field
- A CustomPropertyDrawer that returns a PropertyField for a property named the same as a child field will not render all child fields
- Graphics Settings shows default values instead of the real values in the Rendering Debugger when Volume.profile is assigned via script
- Deleting multiple Tags throws “NullReferenceException”, and "Retrieving array element that was out of bounds" errors when holding the Enter key
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.