Search Issue Tracker
By Design
Votes
2
Found in
5.4.1f1
Issue ID
847371
Regression
No
World space Canvas rendered to a RenderTexture has improper alpha values
When rendering world space canvas to RenderTexture, alpha value of every pixel in rendered texture is affected by the canvas element which is rendered on the top of all other objects rendered by camera.
Reproduction steps:
1. Open attached project (case_847371-CanvasRednerTexture.zip )
2. Open "main" scene
Actual results:
The "RenderedTexture" game object has blue rectangle which is transparent in the middle.
Expected results:
The "RenderedTexture" game object should NOT have transparent part
See attached picture for Actual vs Expected results (blending.png)
In the scene there is "OffscreenRendering" game object which contains all RenderTexture setup. There is red transparent image in front of all other objects. Eventhough all the objects behind red image are not transparent, the rendered texture has transparency where the red image is rendered. (Visible both in Scene and Game views)
Note that alpha values on rendered texture are not exactly the same as of red image. When red image alpha is <0.5 and we decrease it, the rendered texture alpha is increasing.
Canvas rendered directly to Game/Scene view is rendered correctly. (WorldSpaceCanvas game object)
Tested and reproduced on: Unity 5.0.4f1, 5.3.3f1, 5.4.1f1, 5.4.2p3, 5.5.0b10, 5.6.0a1
Comments (1)
-
SergeyLaz
Mar 02, 2020 20:16
fix this, please
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
- Missing script error when clicking “script” link in Cave scene’s Water Sample Description
- [VFX Graph] Set Position Shape Gizmo isn't refreshed after shaper switch
- NullReferenceException is thrown when trying to access volumeStack from the HDCamera class
- Visual artifacts appear when using an Orthographic camera with a Reflection Probe
- Not all animation properties are accessible when a prefab with an avatar model contains a nested copy of itself with a renamed GameObject
Resolution Note:
The Blend operation in the
UI-Defaults.shader is "traditional" SrcAlpha OneMinusSrcAlpha.
Sprite-Defaults.shader works because it uses premultiplied alpha blending One OneMinusSrcAlpha and then rgb *= a in the fragment shader function.