I am growing a drawing app. I exploit MTKView
to render the canvas. However for some cause, for only some customers, the pixels should not rendered accurately (pixels have totally different sizes), the vast majority of customers haven’t any downside with this. Right here is my setup:
- Every pixel is rendered as 2 triangle
MTKView
‘s body dimensions are at all times a number of of the canvas measurement (a 100×100 canvas can have the body measurement of 100×100, 200×200, and so forth)- There’s a grid to point pixels (it is an
UIImageView
), and we are able to see that they do not align with the pixels). - There may be additionally a checkerboard sample within the background which traces up with the pixels however not the grid.
Beforehand, I had the very same difficulty when my view’s body will not be a a number of of the canvas measurement, however I mounted that with the setup above already.
The vertices have correct coordinates, this can be a rendering difficulty. As you’ll be able to see within the image, some pixels are greater than others.
I attempted altering the contentScaleFactor
to 1, 2, and three however none appears to resolve the issue.