Quantcast
Channel: Community | MonoGame - Latest topics
Viewing all articles
Browse latest Browse all 6821

Spirtes Blurry When Full-Screen Resolution Lower Than Desktop Resolution

$
0
0

@PeekFreans wrote:

Good day.

How can I draw my sprites at a lower resolution and keep their pixelated look? When I draw a sprite in my game at my desktop resolution of 1920x1080 in full-screen, it is sharp with no blur. However, drawing the sprite at game resolution 1600x900 in full-screen makes it blurry and mixes the colors. Drawing in windowed mode at any resolution keeps the expected sharpness.

Here is the game at 1920x1080:

and here is the game at 1600x900:

Here is the relevant code:

-Constructor:

    public Game()
    {
        graphics = new GraphicsDeviceManager(this);

        graphics.HardwareModeSwitch = false;
        graphics.GraphicsProfile = GraphicsProfile.Reach;

        graphics.PreferredBackBufferWidth = 1600;
        graphics.PreferredBackBufferHeight = 900;
        graphics.IsFullScreen = true;
        graphics.ApplyChanges();

        IsMouseVisible = true;

        Content.RootDirectory = "Content";
    }

-Draw method:

    protected override void Draw(GameTime gameTime)
    {
        GraphicsDevice.Clear(Color.CornflowerBlue);

        spriteBatch.Begin(SpriteSortMode.BackToFront, 
            BlendState.AlphaBlend, 
            SamplerState.PointClamp, 
            null, null, null, Matrix.CreateScale(1, 1, 0));
        {
            spriteBatch.Draw(testTexture,
                new Vector2(120, 120),
                new Rectangle(0, 0, testTexture.Width, testTexture.Height),
                Color.White);

            #region draw text
            ...
            #endregion

        }
        spriteBatch.End();

        base.Draw(gameTime);
    }

I'm using:
-Monogame version: 3.5.1
-MonoGame Windows Project
-Grahics: Intel HD 530
-OS: Windows 10

Also, when I worked with XNA it would keep the pixel sharpness, but I was using a different computer (Windows 7, integrated graphics).

Any help is welcome.

Posts: 5

Participants: 4

Read full topic


Viewing all articles
Browse latest Browse all 6821

Trending Articles