I’ve tried using:
SynchronizeWithVerticalRetrace = true;
Changing to supported resolutions, altering the camera zoom.
I have tiles that are warped:
Any assistance would be appreciated!
I’ve tried using:
SynchronizeWithVerticalRetrace = true;
Changing to supported resolutions, altering the camera zoom.
I have tiles that are warped:
Any assistance would be appreciated!
That’s not screen tearing I’m afraid, what’s happening is you’re scaling by a non integer number.
For example if you scaling your images to exact whole numbers, (2, 3, 4, etc.) you get things looking correct. If your scaling isn’t an integer you’ll get inconsistent scaling across the pixels when using nearest-neighbour filtering.
Another way to explain would be, imagine scaling an image that is 256 pixels wide to be 510 pixels wide, since 256 does not divide into 510 exactly (it does into 512) what will happen is 2 vertical lines of pixels will only be drawn 1 pixel wide while the other 254 lines will be 2 and so you’ll get this kind of thing happening. Same thing happens with scaling vertically as well.
Here’re a few suggestions to help avoid this, with 'but’s on each:
Other people may have better suggestions.
I’ve not done 2D for a while but is there an orthogonal camera in your code? If yes you could use it to zoom in or out by playing with the matrices and maybe scale it in an easier way?
Thank you for that information. However, the scaling issue is a separate problem. The warped tiles are due to the Zoom within the Monogame.Extended library. I’m literally getting screen tearing as if VSync wasn’t enabled. All across the screen. The only work around I found was to launch a borderless fullscreen window and not in fullscreen mode. Even then performance takes a hit.
Yes Ive tried that. The Camera.Zoom method is part of the Extended library. At it’s default it’s fine but I’d have to redo my art. At 4 where it’s at now, it warps the tiles.
It’s essentially just a scale matrix last time I checked. The code is there for free; you are more than welcome to fork or download the code and debug and edit the codebase to meet your needs.
EDIT: The only thing I can think of that can screw things up potentially is the viewport adapter scaling.