moving sprite ghosting, anything we can do?

Started by
4 comments, last by giordi 8 years, 7 months ago

HI there, I started trying to build a simple engine, the main goal for now is to get a nice structure to the code and flow in the game loop, the first milestone would be to get a character (sprite) jumping and moving in a "fake" 2D environment.

Development was moving forward and fairly smoothly, I got a sprite on screen, I was flipping the different "frame" of the animation by offsetting uvs in a sprite sheet etc , all good. As soon as I added the movement component I started noticing this weird behaviour, the texture looks slightly blurred during movement, or anyway not super sharp as when it s steady. I can see a small ghosting 2-3px behind. I recorded the screen using shadow play (60fps recording) and playing the video I get the same effect, but stepping frame by frame each frame is nice, clean and sharp. That kinda made my heart a bit at ease, thinking that it must be a refreshing issue of the monitor.

But there is still something that bothers me and it is ... why so far on my monitor I did not notice any ghosting while playing? I play mostly 3d games (bf4, witcher etc ) but I play also some platform game like Ori etc ... and as far as a I can remember I don't remember those ghosting problem.

Which make me think is it there anything that can be done software wise to ease this hardware problem? Or maybe is just my case of a single sprite with uniform light grey background a particularly bad case?

Advertisement

Hello.

May be updates how do you do you update timing. Like this Fix Your TimeStep

Yeah sounds like cheap LCD response time issues.
LCDs actually switch between high contrast colours faster than low-contrast ones - they struggle the most with mid-grey transitions. e.g. black-to-white is faster than grey-to-grey!
You can test your art on a cheap LCD and try and tweak the colours to minimize the effect... but personally I wouldn't put too much effort into it.

You can test your monitor over here to see if it suffers from response time issues:
http://www.lagom.nl/lcd-test/response_time.php
Also, get a camera that can take pictures with a fast shutter speed (or "sports mode" if no manual control) and use that to examine what the actual pixel outputs looks like frame-by-frame.

@ankhd: I have implemented two methods , I abstracted it in a "event loop" class, which allows me to run as fast as possible and/or lock to a specific frame rate, by making the thread wait a specific amount of time using a high resolution clock. Also I am using glfw that if you want you can enable vsycn and let it cap the game for you at 60 fps. I tried every combination like glfw lock + fast render , glfw no lock + fast render , glfw no lock + event loop lock etc.

All the same result no exception.

I tried on different monitor, but i think the overall quality of those is the same, and also different os (linux and windows) still same result.

@hodgman, mmm unluckily I don't own an high fps camera. I will have a look if any of my colleagues got one and I will let you know.

First you will need to find out if it is your screen or code, the quickest way would be to use your sprite sheet with Game maker or a similar 2D game engine.If your sprite sheet doesn't produce the same ghost effect then it could be your code.

A while back I had a similar problem, I was animating a texture on a 3D object by moving the UV map. When the camera moved the image on the object would blur by a small amount, it turned out the UV map wasn't aligned with the pixels, as I was using a function that produced results like 0,241 some thing, instead of 0,25.

So my 1024 texture's uv would jump between pixel 250 and pixel 251, instead of 256. when this happened the engine I was using would snap the UV to 250 or 251. The snapping was so fast that I didn't see it when looking at the object, however when I moved the game would first execute my game loop and then update the UV.

You can test if you have a similar problem by swapping small sprites instead of moving the UV map.

Unfortunately it could be many other things, if you provide us with a exe or a sample code we could test it for you.

Hi so I had a friend of mine grabbing the texture and drop it in game maker to make it move left and right in my same way, same exact effect on my and his machine, so I guess I can put my mind at rest and classify it as hardware problem, well guess who is gonna buy a gaming monitor soon!

This topic is closed to new replies.

Advertisement