Search Issue Tracker
Fixed
Fixed in 2021.3.23f1, 2022.2.14f1, 2023.1.0b6, 2023.2.0a4
Votes
0
Found in
2021.3.6f1
2022.1.7f1
2022.2.0a17
2023.1.0a2
2023.2.0a1
Issue ID
UUM-7994
Regression
No
Blitting from RenderTexture.active to another RenderTexture with a shader sampling a texture at specific UV values causes visual artifacts
How to reproduce:
# Open the user-attached project (BlitBug.zip)
# In the “Project” panel open and edit the “TestShader” file
# Modify line 49 by changing {{float2(dx, 0)}} to {{float2(-dx, 0)}}
# In the Editor enter Play Mode
# Switch to the Scene view and observer the “Render Texture Preview“ Game Object
Expected result: the Game Object’s texture is a single solid color
Actual result: the Game Object’s texture has three dark lines going vertically and one diagonal line (when using Vulkan API there are flickering dark squares too)
Reproducible with: 2021.3.6f1, 2022.1.7f1, 2022.2.0a17, 2023.1.0a2
Could not test with: 2020.3.36f1 (due to shader compilation errors)
Reproducible on: Ubuntu 20.04 and Windows 10
Note: The issue is present on both OpenGLCore and Vulkan graphics APIs
Screenshot of the lines visible when using the OpenGLCore API:
!DemoScreenshot.png!
h2. Note after investigation:
This is an undefined behaviour to set source and destination texture to the same one according to the [documentation|https://docs.unity3d.com/ScriptReference/Graphics.Blit.html].
In the user's C# script:
{code:java}
_material.SetTexture(Shader.PropertyToID("_BaseMap"), RenderTexture.active);
Graphics.Blit(RenderTexture.active, camera.targetTexture, _material); {code}
_RenderTexture.active_ and _camera.targetTexture_ are actually the same texture. It's also used in the blit material as a shader property.
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
- "One or more data file missing for baking set NewScene Baking Set. Cannot load shared data." error in Player when a specific project is built
- Choosing new HDR Colour using RGB values breaks colour on Intensity Selectors
- Rendering/Decal Layer Mask options are different inside Prefab Mode and outside Prefab Mode when the project is upgraded to Unity 6
- Incorrect Realtime GI Light Probes baking when more than one Light Probe Group is used and "Baked Global Illumination" is enabled
- Hovering on the three-dot menu also highlights the tab header near it when not all tabs fit the bar
Resolution Note (fix version 2021.3.23f1):
Before the fix, no console message was provided about graphics glitching. After the fix, the console window presents a new warning for the user