Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Blurred tiles when moving  (Read 2739 times)

0 Members and 1 Guest are viewing this topic.

LogicStuff

  • Newbie
  • *
  • Posts: 7
    • View Profile
    • Email
Blurred tiles when moving
« on: August 03, 2015, 11:01:27 pm »
Hello again, this time I come with an unpleasant blurring I've been experiencing since the beginning of making my 2D game. I have V-sync enabled and I'm sure not rendering every other frame without tiles.

It looks ugly and can be seen the best when walking/stopping, mostly on tiles with transparent background. The web tiles also kind of oscillate. What's going on here?

Jesper Juhl

  • Hero Member
  • *****
  • Posts: 1405
    • View Profile
    • Email
Re: Blurred tiles when moving
« Reply #1 on: August 03, 2015, 11:44:21 pm »
1. Vsync affects the framerate and tearing. Not blurring, so that bit is probably irrelevant.
2. Are you using .setSmooth()? That might result in some blurring.
3. Are you rendering to integer or float coordinates? If not integer, then try to round your positions to integers before drawing.
4. Are you using a view to scale things? If so, does the scale ratio result in nice integer results? If not, that may be your problem.

See also http://sscce.org/ if you want us to be able to test (and comment on) your specific code..
« Last Edit: August 03, 2015, 11:51:50 pm by Jesper Juhl »

LogicStuff

  • Newbie
  • *
  • Posts: 7
    • View Profile
    • Email
Re: Blurred tiles when moving
« Reply #2 on: August 04, 2015, 12:21:05 am »
2. No, I'm not.
3. Doesn't matter if I walk just in integer coordinates or round the floats, same effect.
4. I was using the default view (640x480) in the example, but I can also zoom to nice multiples - 160x120, 320x240 and 1280x960.

I'll work then on SSCCE, if that works fine, I'll be shocked.

Hapax

  • Hero Member
  • *****
  • Posts: 3371
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Re: Blurred tiles when moving
« Reply #3 on: August 04, 2015, 01:59:52 am »
It looks a lot like the apparent blurriness is from slow frame rate and the resulting jerky stepping motion.
Stopping on a frame in the video looks slightly blurry though but this looks like it has recorded two frames.
Selba Ward -SFML drawables
Cheese Map -Drawable Layered Tile Map
Kairos -Timing Library
Grambol
 *Hapaxia Links*

LogicStuff

  • Newbie
  • *
  • Posts: 7
    • View Profile
    • Email
Re: Blurred tiles when moving
« Reply #4 on: August 04, 2015, 09:51:01 am »
Despite the quality, the video pretty much represents what I'm seeing on a monitor. That shadow on top of each tile is caused by compression though. The thing I was trying to capture is that when moving, it all fades into blue and becomes darker.

LogicStuff

  • Newbie
  • *
  • Posts: 7
    • View Profile
    • Email
SSCCE
« Reply #5 on: August 04, 2015, 11:46:15 am »
The example in a few lines of code, executable attached (built under debug, dynamically linked to system, window and graphics DLLs).

dabbertorres

  • Hero Member
  • *****
  • Posts: 506
    • View Profile
    • website/blog
Re: Blurred tiles when moving
« Reply #6 on: August 04, 2015, 06:49:34 pm »
I'm not seeing any blur here, and I ran your exe as well as compiling it myself as well.

What graphics card and driver do you have? You might have a driver setting on.
Or, what kind of monitor are you using? I know that some monitors/TVs nowadays are starting to do automatic interpolation between frames.

LogicStuff

  • Newbie
  • *
  • Posts: 7
    • View Profile
    • Email
Re: Blurred tiles when moving
« Reply #7 on: August 04, 2015, 07:53:27 pm »
What driver setting do you have in mind? I have AMD Radeon HD 6670 on my desktop with few years old BenQ GL 2450 monitor. I've also tested it on my laptop with ATI Mobility Radeon HD 3650 and seen the blur, not so much, because the monitor gives slightly less amount of blue, but the webs and the white strip on TNTs got darker... On the desktop, the saplings were most disturbing. I don't know, I'm going to try another computers I have handy.

dabbertorres

  • Hero Member
  • *****
  • Posts: 506
    • View Profile
    • website/blog
Re: Blurred tiles when moving
« Reply #8 on: August 04, 2015, 08:58:59 pm »
Something along the lines of "interpolation" would be my guess. Unfortunately, I haven't used an AMD card in a long time, so I don't remember much of the driver settings.

Hapax

  • Hero Member
  • *****
  • Posts: 3371
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Re: Blurred tiles when moving
« Reply #9 on: August 05, 2015, 12:15:34 am »
I just run the source code you posted and it turns out that this also happens to me; it blurs slightly when moving.
Since this is probably a monitor or driver issue (I'm also using an AMD card), it was impossible to take a screen shot of the actual blur so I created one in Photoshop. It looks exactly as I saw it. Guess how I made it! That's right; I added motion blur to it  8)

Stationary:


Moving:


Is this the blurring that you are seeing? Note that it looks nothing at all like the video  :P

It could very well be a monitor issue where the monitor's pixels slowly transition from colour to colour (pixel response time), which - when too slow - causes noticable display motion blur. I assume you're using an LCD monitor...

Just scrolling this webpage with this image on it causes the same effect!  ;D
Selba Ward -SFML drawables
Cheese Map -Drawable Layered Tile Map
Kairos -Timing Library
Grambol
 *Hapaxia Links*

 

anything