Search Issue Tracker
Fixed in 2020.1.X
Fixed in 2018.4.X, 2019.2.X, 2019.3.X
Votes
0
Found in
2017.4.0f1
2018.3.0a1
2018.4.0f1
2019.1.0a1
2019.2.0a1
2019.2.0f1
2019.3.0a1
Issue ID
1174789
Regression
No
Unable to override ColorMask in a Surface Shader with an Alpha Pragma directive
Customer been trying to render objects with Surface Shaders (using the legacy Rendering Pipeline) that use Alpha Transparency onto a Render target and found that the alpha value of those Shaders does not get written to the Render Texture because the ColorMask render state is forced to RGB.
To reproduce:
1. Download attached "SurfaceShaderColorMaskIssue.zip" project and open in Unity
2. Open "SampleScene" scene
3. Select the "Transparent Surface Shader" in Project window
4. In Inspector, click on "Show generated Code"
5. See at the Generated Code
Expected result: The generated code should not override the ColorMask value
Actual result: The line "ZWrite Off ColorMask RGB" is added, overriding the "ColorMask RGBA"
Notes:
- This issue reproduces on both Windows and macOS
- This old case seems related to a Case 425429 and Case 618826
Reproduced on Unity 2017.4.0f1, 2017.4.31f1, 2018.3.14f1, 2018.4.5f1, 2019.1.14f1, 2019.2.1f1 and 2019.3.0a11
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
- Articulation Body with 'Revolute' Joint Type has erratic behavior when Upper Limit is set to above 360
- WebGL Player fails to render Scene when Terrain with Detail Mesh is added and WebGPU Graphics API is used
- Inconsistent errors are logged when different types are passed into the Query "Q<>" method in UIToolkit and the ancestor VisualElement is null
- Crash on GetMaterialPropertyByIndex when opening a specific Scene
- Discrepancies in the styling are present when using a TSS file instead of a USS file in custom EditorWindow
Alexander_V
Feb 28, 2024 23:17
Unity 2022.3.10f Issue is still present.
Generated code overrides ColorMask
sebj
Mar 22, 2021 15:26
This has not been fixed.
Steps to re-produce (in 2020.1.17 & 2020.2.3 at least)
1. Create a new project with 2020.1.17
2. Create -> Shader -> Standard Surface Shader
3. Add alpha:fade to line 17
4. Save
5. Select Shader and click Show generated code
6. See the ColorMask RGB remains on line 18