Blurry sprite when moving sprites using integers & pointclamp

Hi,
It is been days Im trying to figure this problem out so I tought it would be a good idea to ask for some help here if you dont mind ^^

Thanks you very much in advance and sorry for my broken english, it is not my mother tongue).

I move my sprites using integers and pointclamp, after google search I have found nothing on this. Most of the issues where from people using floats or double to store positions.

I apply velocity to world position i and j then I convert this into screenposition.

destination.Width = entity.body().scaledWidth;
destination.Height = entity.body().scaledHeight;
destination.X = entity.body().x;
destination.Y = entity.body().y;

source.Width = scene.texture(entity.visual().texture).framesize;
source.Height = scene.texture(entity.visual().texture).framesize;
source.X = scene.texture(entity.visual().texture).sx(entity.visual().frame);
source.Y = scene.texture(entity.visual().texture).sy(entity.visual().frame);
  • X, Y, SCALEDWIDTH and SCALEDHEIGHT are screencoordinates
  • I, J, WIDTH and HEIGHT are worldcoordinates

is basically what I draw using

spritebatch.Begin(SpriteSortMode.Deferred, BlendState.NonPremultiplied,     SamplerState.PointClamp, DepthStencilState.Default, RasterizerState.CullNone);

I tried to disable my camera but I also got the blurry sprites when it moves. The problem doesnt seem to be related to the camera transforming the coordinates.

The sprite moves like this

private void up() { body().j -= body().velocity; }
private void down() { body().j += body().velocity; }
private void left() { body().i -= body().velocity; }
private void right() { body().i += body().velocity; }`

It is all integers. No float, no decimals, etc…

Do you have any idea what would be causing the problem ?
If you need more code I can provide it, I just dont know what parts you need to figure this out.

Can you screenshot or record the blur? It might be your screen that is blurring because it might not be able to change colour fast enough.

I tried to use the print screen keys but it didnt catched the blur at all.
I do not have any record software on my computer sorry.

If you any clue even on what could cause this Im still all hears.

I keep trying to find something on google but everything leads to using floating numbers.
Do the position of elements on screen should be multiple of something, like tilesize ? To avoid in between pixel drawing ?

Sorry if I speak gibrish, I do not have a good understanding of what happens behind the scene of monogame.

Even one tiny clue is very welcome. I can work from that.
Thank you very much for your time.

If you’re unable to capture it in a screenshot maybe it’s not actually there?

If you’re only seeing it when an object is moving then maybe it’s your monitor/your eyes playing tricks on you?

I’d try reproducing the problem and hitting PrintScreen (or if your on a Mac then whatever the hotkey is) while you’re moving and see if you can catch it in the act. If the screenshot looks okay then I’d bet there’s no actual blur.

1 Like

Correct, if it is capturable with print screen then chances are it is ghosting effect of given display.