I just switched from XNA to MonoGame. So far, my project is working 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
I’m looking forward to your responses!
Try replacing your spritebatch being with
I cannot really see the quality issue because I do not have my glasses atm (they broke! ) 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
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
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 And since I reverted, everything looks fine again
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.