Search Issue Tracker
By Design
Votes
0
Found in
2017.3.0b1
2017.4.0f1
2018.3.0a1
2018.3.0f2
2019.1.0a1
2019.2.0a1
Issue ID
1119129
Regression
No
[Mac only] Input uv coordinates do not quite match the center of the screen-space fragments when using Graphics.Blit
How to reproduce:
1. Open the attached project
2. Enter the Play mode
3. Change the Game view size (see the Case608300.gif attached)
Expected: Both triangles are the same
Actual: Viewport sizes the 'uv.x' value is different for one of the triangles of the screen-space
Reproduced with: 2017.4.19f1, 2018.3.3f1, 2019.1.0b1, 2019.2.0a2
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
- Reference to a deleted GameObject becomes "None" instead of "Missing" when the GameObject is restored with undo after entering and exiting Play Mode
- Size value in Particle System Curve's tab is highlighted with selection across all tab header
- Particle System Curve's Presets window has no visual indication of what preset is selected
- Blur shader doesn't work when the "Scene Color" Node is attached to the UI "Output" Node
- Particle System Curve presets can't be scrolled and some of them can't be selected if window is too narrow to fit them all
Resolution Note (2019.2.X):
Unity's Graphics.Blit API is currently specified to be implemented using a full-screen quad, meaning it consists of 2 triangles completely filling the rendertarget.
Unfortunately there is no guarantee within the underlying graphics hardware or graphics APIs that the interpolated values will perfectly match in the 2 adjacent triangles of such a quad.
The observed differences between UV coordinates between the 2 triangles are within the required interpolation precision range of the graphics hardware, due to floating point based precision issues in interpolated attributes in the different vertices of the 2 triangles. The example case in this bug here is amplifying the very slight differences in interpolation, causing visible glitches when used with odd resolutions.
Unfortunately this is unavoidable due to how the API is defined to work.
If exact consistancy is required between the 2 triangles of the quad, then the screen-space coordinates of fragments should be used rather than interpolated attributes, for example using using the WPOS semantic, or else the shader should be written to tolerate the very small precision differences between the interpolated values within the 2 triangles.
An alternative workaround would be to render a fullscreen triangle for the implementation of the blit operation, that is, rendering a single triangle that fills the entire framebuffer rather than using a full screen quad such as using in the implementation of Graphics.Blit.