Search Issue Tracker
By Design
Votes
0
Found in [Package]
12.0.0
Issue ID
1324926
Regression
No
[ShaderGraph] Visual artifacts between two colors when using Replace Color Node for changing the Sprite colors
How to reproduce:
1. Open the user's attached "Test Project.zip" project
2. Open the "Main" Scene
3. Observe the Sprite in the Game view
Expected result: No artifacts on the Sprite
Actual result: Visual artifacts in places of the Sprite where color about to change
Reproducible with: 10.4.0 (2020.3.2f1), 11.0.0 (2021.1.2f1), 12.0.0 (2021.2.0a11)
Could not test with: 7.5.3 (2019.4.23f1) - Due to Shader Graph not working after downgrading
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
- Graphics.DrawMeshInstanced does not work when 2D Renderer and 2D Shaders are used
- SpeedTree does not move when using WindZone
- "Undeclared identifier 'LinearToSRGB'" error is thrown when creating a color variable with HDR color mode and assigning a Custom Render Texture target in Shader Graph
- Input System package is missing when creating a new HDRP project
- Inconsistent behaviour when interacting with different dropdown types with pointer events on parent Visual Element
Resolution Note:
Looking at the setup, it looks as though the hlsl code is doing what it is supposed to. There are small differences in the color of the image where the replace is happening. With the current node settings, any color within 1% of the original selected color is replaced. In the provided example, the two closest colors are 1.4% distant from eachother (on the cheek shadow). Increasing the range on the replace color node and allowing some fuzziness seems to grab more of what looks like the correct color, but is still not perfect. Its possible the image might have been compressed or interpolated in some way on the asset side, maybe by some importer change with the LTS version? It may be worthwhile to use mask textures to provide better control on the output color rather than using color replacement and getting small artifacts like these.