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, also i tried this.GraphicsDevice.SamplerStates = SamplerState.PointClamp and disable PreferMultiSampling but nothing works. Someone tell me that can be fixed using renderTargets, and i tried that by my self but i didn’t work too :c. I used spriteBatch.GraphicsDevice.SetRenderTarget(renderTarget) and null at draw method but still looks blurry. How i use renderTarget? is it replace my sprite? Need to be window scale or sprite scale? Help Please :c
Need a bit more info. What shader are you using? Did you disable mipmapping when loading the texture? Could I see a little of the drawing code and/or shader?
according to me I am not using any shader. Don’t know how i can disable bitmapping. Here is my drawing code:
spriteBatch.GraphicsDevice.SetRenderTarget(renderTarget); //This will clear what's on the screen each frame, if we don't clear the screen will look like a mess: GraphicsDevice.Clear(Color.CornflowerBlue); spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.None, RasterizerState.CullNone, null); spriteBatch.Draw(sprite, pos, Color.White); spriteBatch.End(); spriteBatch.GraphicsDevice.SetRenderTarget(null); spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, null, null, null); Resolution.BeginDraw(); spriteBatch.Draw(renderTarget, new Rectangle(0, 0, screenWidth, screenHeight), Color.White); //Draw stuff onto the render target spriteBatch.End(); //Draw the things FNA handles for us underneath the hood: base.Draw(gameTime); }
If your render target is stretched onto the back buffer the text will blur.
Typically you don’t want to stretch fonts at all.
Hinted fon’ts work best with spritebatch especially at large resolutions.
You can open a spritefont in your content folder with for example note pad or visual studio, scrolling down you will see that you can change the font size as well.
I suggest you try simply drawing text last without drawing it to a rendertarget first and without changing its size other then by changing the font size in the spritefont file.
I also suggest trying to load a well hinted font to test the difference which is probably installed on your computer already.
the 7.0 ones are probably also well hinted.
Monogame under the hood uses a true type lib so it is gear best for well hinted fonts instead of bitmaps.
If you are primarily using your own bitmaps you might want to check out spritefont plus
Which is better in my opinion at specifically rasterizing bitmap fonts and were serious scaling is requisite.