XNA Jittering sprites (PLEASE HELP)

Started by
5 comments, last by matthughson 10 years, 3 months ago

I'm making a 2d top down game in XNA. I have encountered a problem where, because iv scaled all of my sprites by a tiny bit. Whenever the player moves. all of the sorrounding sprites are jittering almost like flickering, the edges on them and such. Does anyone know what this could be and have any possible solutions ?

Advertisement

Doesn't sound like scaling should be the cause - how have you done the scaling? Are *all* sprites scaled, and *all* sprites jittery? Can you comment out the code to scale, and everything works fine again?

Storm Clouds over the Western Front - 2D aerial combat WIP | DarklightXNA on Twitter | 2DFlightSim on Youtube

Yes if we go back to the original zoom level. everything is 100% fine. Its only when we zoom everything out by like 20% that we get jitters happening when we move

Just throwing out some guesses:

Are you using a texture atlas? Try messing with the texture wrapping modes, and possibly mipmapping settings - the sampler may be catching neighboring pixels in the atlas when scaling down.

Are you alpha blending and the borders of the sprites are (semi)transparent? Check your blending settings, IIRC XNA uses premultiplied blending by default.

I'd look at how you are converting world coords to screen coords. Print out the data over the course of a few seconds: x/y/top/left/height/width and whatever offsets you calculate. Do you round off anywhere? How is your zoom implemented?

What kind of jitter? Is this 'Crackle of Life' or 'game vibrato'?

The Four Horsemen of Happiness have left.

Ensure your texture have mipmaps (in the properties for the texture in the content project).

Can you post a video?

__________________________________[ Website ] [ Résumé ] [ [email=contact[at]matthughson[dot]com]Contact[/email] ][ Have I been Helpful? Hook me up! ]

This topic is closed to new replies.

Advertisement