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
- [Android] Crash on vendor/lib64/egl/libGLES_mali.so when Graphics Jobs(Experimental) is disabled and the Player is running on the Google Pixel 6 with the March security patch installed
- Profiler does not profile after building the Project with Autoconnect Profiler Option enabled
- Editor slows down when selecting a script with the [HideInInspector] attribute on arrays with dynamic values
- [XR] Custom Pass not working as intended with Single Pass Instanced when XR is initialized after runtime start
- NullReferenceException floods the Console when Previewing Probe Adjustments before Probe Volume Baking is finished, Prove Volume Baking hangs
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.