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

Shadows/Lights

-

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

  1. 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.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.