Search Issue Tracker
Fixed in 2021.3.23f1
Fixed in 2021.3.X, 2022.2.X, 2023.1.X, 2023.2.X, 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.
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
- "Layer Palette Profile" Asset is automatically applied to the second Terrain but doesn't load any layers
- "Terrain Tools" shortcut conflicts with the Overlays shortcut by default
- Longer Shader Graph Property Reference names breaks VFX Graph Output Particle Node
- Inconsistent hotkeys in the Terrain tool with the "Terrain Tools" installed and not installed
- "DebugAllocatorMode" option changes when changed in another Editor instance
Resolution Note (fix version 2021.3):
Before the fix, no console message was provided about graphics glitching. After the fix, the console window presents a new warning for the user