Disabling multisampling + other anomalies

Hello everyone,

I’ve created a program that uses a tilemap to draw textures from a texture atlas onto a quad using HLSL.

I now however have texture bleeding and I have no idea how to set the SamplerState to sample on Point (so each actual pixel in the texture is used). I have tried setting it manually inside the shader like this:

SamplerState SpriteSheetSampler
{
AddressU = Wrap;
AddressV = Wrap;
MinFilter = Point;
MagFilter = Point;
MipFilter = Point;
};

But there is no visual change. I also tried creating a SamplerState object and setting the Filter to TextureFilter.Point then assigning GraphicsDevice.SamplerStates[0] to this SamplerState object. Then using a register like this: SamplerState SpriteSheetSampler : register(s0); However this also didn’t change anything.

Just to be sure, this is what I’m looking at:

And these are the neighbouring tiles of the blue tile:

So it’s sampling the purple, yellow and brown from within the blue tile.

Lastly I have these two anomalies that I have no clue what’s causing them:

  1. Once zoomed out the “dirt” tiles become magnified, and then after a certain point are mirrored (or inverted, I’m not sure) and then become smaller again.

  2. Lines appear when zooming out:

I’m hoping someone with extensive (or not) knowledge knows how to fix these issues?

How do you import the tilemap? Do you generate Mipmaps?

I’ve managed to fix the multisampling of the textures. I have 2 SamplerStates, one called HeightMapSampler and another called SpriteSheetSampler. Now I noticed when I put GraphicsDevice.SamplerStates[0] to SamplerState.PointWrap that the tiles were being correctly chosen (before it would choose, again due to multisampling, the adjacent tile from the tilemap resulting in the sandbank having a different sprite at the edges). Now after digging some more through posts from 2010 and so on I found that the order in which the SamplerStates are declared is apparently vital (HeightMapSampler is declared first).

So without even setting a register I managed to fix the multisampling on the SpriteSheet by putting GraphicsDevice.SamplerStates[1] to SamplerState.PointWrap, resulting in SpriteSheetSampler choosing the correct SamplerState. The lines in the last screenshot have also disappeared by the way.

Now I’m only stuck with anomaly 1, where the textures (not just the dirt one I noticed) are magnified when zooming out, mirrored or put upside down and then demagnified.
If you mean with “Generate mipmaps” setting the mipmap option in the MonoGame PipeLine to true, then yes.