2
\$\begingroup\$

I'm trying to make a pixel art game and my resolution is 384 x 224, but when I change to fullscreen the sprites looks blurry and I don't know how I can disable bilinear filtering.

I tried SamplerState.PointClamp on spriteBatch.Begin but it didn't work, I also tried this.GraphicsDevice.SamplerStates[0] = SamplerState.PointClamp and disable PreferMultiSampling but nothing works. Someone told me that it can be fixed using renderTargets, and I tried that by myself, but that didn't work either.

I used spriteBatch.GraphicsDevice.SetRenderTarget(renderTarget) and null at draw method but it still looks blurry. How do I use renderTarget? does it replace my sprite? Does it needs to be window scale or sprite scale? Help please

PD: I'm using FNA, but it seems to monogame. Is a reimplementation of XNA

\$\endgroup\$
2
\$\begingroup\$

What happens here is that your "screen" the game renders to is still the same resolution, and that is then crudely scaled to your physical screen.

You need to override the screen resize event and set your back buffer size to your actual screen dimensions.

This generally means creating an event handler such as this:

private void Window_ClientSizeChanged(object sender, System.EventArgs e)
{
    graphics.PreferredBackBufferWidth = Window.ClientBounds.Width;
    graphics.PreferredBackBufferHeight = Window.ClientBounds.Height;
    graphics.ApplyChanges();
}

and then putting Window.ClientSizeChanged += Window_ClientSizeChanged; in your Game class's Init method.

It will then instruct the graphics device to render to a bigger "panel" which then gets displayed on your screen.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.