0
\$\begingroup\$

So I've been developing a platformer and the when the player moves around the world the background images and tiles become really blurry. I've tried a number of fixes. I've made sure that the position given out by the camera and player are both whole numbers as you can see in the video below.

http://www.youtube.com/watch?v=1AFuP1yXhY4&feature=youtu.be

On top of that I've also made it a point to use PointWrap in every SpriteBatch call made in the game

spriteBatch.Begin(SpriteSortMode.Texture,
                   BlendState.AlphaBlend,
                   SamplerState.PointWrap, null, null, null,
                   camera.TransformMatrix);

None of these works are really working, could someone please give me some other suggestions to try ?

\$\endgroup\$
2
  • \$\begingroup\$ Can you describe the problem more specifically? The video doesn't make the problem obvious. On Youtube it just looks like background textures moving quickly. Also, what fixes did you already try, and what were the results? \$\endgroup\$ Dec 30, 2013 at 17:04
  • \$\begingroup\$ Same here, not sure what the problem is. Looks as I'd expect it to look, but the video isn't telling the whole story methinks. I'm not sure why you'd want to draw everything with whole numbers? It should be perfectly okay (and recommended) to pass floats as coordinates to any modern graphics API. If the background movement is jerky/stuttery, I'd guess this is your problem. \$\endgroup\$
    – Supermuumi
    Dec 30, 2013 at 22:25

1 Answer 1

1
\$\begingroup\$

I had the same issue. Try the following:

Set PreferMultiSampling to false to prevent multi sampling this.graphics.PreferMultiSampling = false;

cast the camera positions to int if you can it

set the sampler state to PointWrap, (SamplerState.PointWrap)

if nothing helps, try to use a power of two texture for the tiles, background etc. 256, 512, 1024 ....

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .