Search Issue Tracker
By Design
Votes
1
Found in
4.3.1f1
Issue ID
582978
Regression
No
Background sprite can be visible when it shouldn't (due to alpha)
To reproduce:
1. Open attached project
2. Open scene "Game". It contains three sprites - a flower with alpha on it's edges, a grass sprite and a background sprite with white edges
3. In play mode, notice how the white edges of the "BG" sprite are visible on the shadow parts of the flower (alpha) even though there is a sprite covering the "BG"
4. Move the flower away - the lines are no longer visible
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
- Crash on PrepareDrawShadowsCommandStep1 when entering the Play Mode in a specific project
- Physics Layer Collision Matrix's Layer names, checkboxes and hover highlights become misaligned when the Editor's UI Scaling gets changed
- Light/shadow information on an edge of a Terrain tile creates a seam with an adjacent Terrain tile when baking a LightMap
- "Missing types referenced from component UniversalRenderPipelineGlobalSettings on game object UniversalRenderPipelineGlobalSettings..." warning is thrown after switching the Platform to tvOS
- “Metal: Error creating pipeline state (Universal Render Pipeline/2D/Sprite-Lit-Default): Vertex attribute BLENDINDICES0(5) of type uint4 cannot be read using MTLAttributeFormatFloat2 (null)“ when setting GPU Skinning to GPU after opening the project
TomasJ
Mar 26, 2014 10:46
The alpha issue isn't exactly a bug, but a way Unity does blending. This happens because textures are not with premultiplied alpha.
You can work around in one of the following ways:
- Duplicate the desired shader and change blending to "Blend SrcAlpha OneMinusSrcAlpha, One OneMinusSrcAlpha" - this will set different blending mode for alpha, but might not be supported on some mobile GPUs.
- Duplicate the desired shader and emulate premultiplied alpha:
-- Set blending to "Blend One OneMinusSrcAlpha"
-- Multiply RGB by alpha in the pixel shader (final.rgb *= final.a)