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
- The Editor crashes when Generating Font Atlas in the Font Asset Creator with “9999999999” padding and 256x256 Atlas Resolution
- [iOS] An “ArgumentNullException” error is thrown when GetIntroductoryPriceDictionary() method is called
- Memory leak warnings are constantly thrown when Generating Font Atlas in Font Asset Creator with 4096x8192 Atlas Resolution
- “Glyph rendering has been aborted due to sampling point size” Log is printed and Font Atlas is not generated when Atlas Resolution is 8192x8192, and the Render Mode is SDF
- Font Import Settings documentation page is missing when the documentation button is pressed in the Inspector window
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.