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
- Some UXML Template Asset foldouts appear enabled when all fields inside are disabled
- URP Terrain Demo crash on burst_signal_handler after Generating lighting
- Project window button icons are poorly visible and their shades differ in Light theme
- GC.Alloc called by HDRenderPipeline.LensFlareMergeOcclusionDataDrivenPass() when playing the default HDRP Sample Template project
- Automatic LOD fails and SRP Batcher incompatibility occurs when using spline-based quad-topology meshes
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.