Weird flickering grid when rendering a tilemap

Hi there everyone!
I’m trying to render a tile-map created with Tiled Map Editor. I’ve parsed the map file and for each tile in layer got it’s X and Y offsets in the world and texture (tileset) coordinates and then in a cycle I call for render of a texture’s part.
The map looks good at first, but as I move the camera using Camera2d helper class I get weird flickering grid between the tiles.
Probably that’s because I render tiles separately, but how do I render 'em so they won’t flicker then?

Rendering code looks like this:

_spriteBatch.Begin(SpriteSortMode.Deferred, null, null, null, null, null, Camera.TransformMatrix*Matrix.CreateScale(Camera.Zoom));

And here’s the code to change camera’s transform:

private void SetCameraView(GameTime gameTime, MouseState mouseState)
    var delta = mouseState.ScrollWheelValue - _inputState.PreviousMouseState.ScrollWheelValue;
    if (delta != 0)
        Camera.Zoom += 5f*Math.Sign(delta)*(float) gameTime.ElapsedGameTime.TotalSeconds*Camera.Zoom;

    if (mouseState.MiddleButton == ButtonState.Pressed)
        if (_inputState.PreviousMouseState.MiddleButton == ButtonState.Released)
            _panOrigin = mouseState.Position.ToVector2();

        var pan = mouseState.Position.ToVector2() - _panOrigin;
        var dt = (float) gameTime.ElapsedGameTime.TotalMilliseconds/1000;
        Camera.TransformMatrix *= Matrix.CreateTranslation(new Vector3(pan, 0)*dt*30);
        _panOrigin += pan*dt*10;

And here is how it looks.
P.S. When zoomed a little in they stop flickering and can be clearly seen.

I’ve tried rendering a smaller source area from texture and it worked - the ‘grid’ disappeared. It looks like the texture is blured and this artifact comes from blured grid from source texture.
Is there a way to load a texture as it is (set filtering mode? or is it available only for 3D textures?)?

Found out that the grid appeared as the result of blurred texture. When I set SamplerState to SamplerState.PointClamp in SpriteBatch.Begin method - it was gone. Yet I still see artifacts (black lines) when moving the map and for now I have no idea why they appear :frowning:

Are you clearing the background to black? If you’re passing floating point values to SpriteBatch.Draw, it could be drawing some tiles offset by 1 pixel from the others. Try truncating the Vector2 position to integers before drawing.

The only other possible cause I can think of is related to the texture filtering. If you’re drawing the texture scaled down, and there are black areas next to the drawn tiles in your sprite sheet, it may be sampling from the black area incorrectly.