Mono Game Graphic Quality Issues

Hey guys,
I just switched from XNA to MonoGame. So far, my project is working :smile: But now I have the following problem: When Iā€™m using a Camera for my 2D-Application and change my zoom level, the quality is a completely mess.
Here you can see the standard zoom. The lines are displayed correctly and everything looks nice so far


But if I change the zoom level, the result is this:

I already tried to change the AA-Quality from my program, no results :frowning:
Iā€™m looking forward to your responses!
Best regards,
David

Try replacing your spritebatch being with
spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.NonPremultiplied);

I cannot really see the quality issue because I do not have my glasses atm (they broke! :frowning: ) and I assume this might be your issue.

Hope it helps!

Also very cool looking program, i assume its a music player maybe editor? Ether way I wouldnā€™t mind having a copy of it myself! Link to website maybe?

Thanks for your reply, I will test it later.
There will be a website soon for the program (http://www.midilizer.com/) . Itā€™s called midilizer, which is little similar to synthesia, but with more options like music library, game and training mode for piano tracks.
An editor option may come later :slight_smile:

Apologies for hijacking the thread but I wondered what you used for sounds? I used naudio to play ā€œmidiā€ sounds as I couldnā€™t find anything within monogame to play midi sounds.

Jep, I used naudio for my tool also to play midi sounds. So itā€™s unfortunately an only for windows game.

@Nullz: Unfortunately, your hint didnā€™t work =(
Right now, Iā€™m calling

spritebatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, SamplerState.PointClamp, null, null, null, camera.TransformMatrix);

Maybe I can explain the problem to make it a little more clear: If I zoom out, the spritebatch doesnā€™t draw thin lines anymore. But it occurs non-deterministicā€¦ For example: If I zoom out, a line suddenly disappears, in the next zome level, the invisible line before becomes visible again, but then another line gets hidden.
Another big issue is, that the sprites begin to flatter, when the camera moves. So itā€™s a really ugly look =/
Do you have any ideas?

Well no clue, however this might help. XNA is based off of directx, I dont know if your using the direct x or opengl version of monogame (https://gyazo.com/219af72993a9afcc91b0fa215af61c09) ether way try to see if anything changes in the opposite version of which your are using.

Best of luck mate!

Thanks mate! I think, Iā€™m using DirectXā€¦ But now, I will try OpenGL also. If I do any progress, I will let you know :wink:

howā€™s the fix coming along? And sorry read your message wrong, replace spritebatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, SamplerState.PointClamp, null, null, null, camera.TransformMatrix); with spritebatch.Begin(SpriteSortMode.Immediate, BlendState.NonPremultiplied, SamplerState.PointClamp, null, null, null, camera.TransformMatrix); then.

Hey, no problem! =)
It seems, MonoGame doesnā€™t like me =/ Even your last tip didnā€™t workā€¦ It doesnā€™t matter, if I use directX or openGLā€¦ Maybe I did something wrong with the ā€œcameraā€ settingsā€¦ Itā€™s a really weird situtation

Iā€™ve got this son of a *** xDD
I compared my XNA with my MonoGame version and found out: The RenderTarget2D doesnā€™t support AA in MonoGame right nowā€¦ Without AA, I get the same mess in XNA. Is there a way to get this to work with MonoGame?

My only idea is to try to figure out a way to not use rendertarget2D. I also have yet to learn how to use rendertargets so I really do have no clue how to help.

No problem =) I just reverted to XNA yesterdayā€¦ I had some more bugs, so I decided, that MonoGame is not the framework I need :wink: And since I reverted, everything looks fine again :smiley:

Just use Linear sampling instead of pointā€¦ thatĀ“s all you needā€¦ point decides if specific pixel is visible or not (it doesnĀ“t interpolate any information), thus if given pixel is missed on given spot of screen it wont be visible at all. Linear sampling will display it depending on pixel distance from spot on screen. For example if you are rendering pixel between black and white texels (letĀ“s say you are sampling texture) then you will get 50% grey pixel.

Thus all you want to do all this time is just: spritebatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, SamplerState.LinearClampā€¦

This will demonstrate: https://mynameismjp.files.wordpress.com/2012/10/point_linear_filtering.png Obviously in case of zooming out point sampling results in missing pixels, possibly even in case of moving camera or objects by subpixel values.