Search Issue Tracker
Won't Fix
Votes
0
Found in
2019.4
2020.3
2020.3.26f1
2021.2
2022.1
2022.2
Issue ID
1403055
Regression
No
GameObject Opacity increases when adding light sources to Scene
How to reproduce:
1. Open the attached project (AlphaBugTest2.zip)
2. Open scene Scenes/SampleScene
3. Press the Play button and observe the Game view
Expected result: the opacity of the Cubes does not increase with each added Light
Actual result: the opacity of the Cubes increases with each added light
Reproducible with: 2019.4.36f1, 2020.3.31f1, 2021.2.16f1, 2022.1.0b12, 2022.2.0a8
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
- [UI Builder] Viewport's gizmos for Margin and Padding disappear when dragging to modify the value and the cursor leaves the Spacing section
- "Multiplayer Center" window does not reflect changes made in "Other Packages" section
- Crash on D3DKMTOpenResource when capturing with RenderDoc while GPU Skinning is set to GPU(Batched)
- Editing and saving Curve changes in UI Builder window throws multiple errors in the Console
- [UI Builder] Value is not selected when left clicking on Spacing/Border Widget values
Resolution Note:
When using Transparent mode, the Standard shader for Builtin Render Pipeline uses the following blend modes (https://docs.unity3d.com/Manual/SL-Blend.html):
ForwardBase pass: Blend One OneMinusSrcAlpha
ForwardAdd pass: Blend One One
These mean respectively:
outColor = 1 * src + (1 - src.a) * dst
outColor = 1 * src + 1 * dst
Where 'src' is the color produced by the shader, and 'dst' is the color present in the framebuffer already. These blend modes apply to the entire colors, which includes the alpha channel. The blend mode of the ForwardAdd pass is causing issues in this case, since the alpha value produced is being added onto the one existing in the framebuffer.
Unity supports specifying separate blending factors for both the rgb and alpha channels, which can be used to work around this. In particular, a blend mode of 'Blend One One, Zero One' may be desirable, since this means "blend the rgb values additively, but just take existing alpha value from the framebuffer and ignore the output of the add-pass". This change can be made to a copy of the Standard shader, for which the source code is readily available, or by creating a custom shader that fits the requirements.
We won't fix this issue as it is specific to the Builtin Render Pipeline, and can change the appearance of existing projects.