tmxlite icon indicating copy to clipboard operation
tmxlite copied to clipboard

Blinking between tiles in SFML Demo

Open DmitruMoth opened this issue 4 years ago • 4 comments

So, problem is here: map.zip blinking

DmitruMoth avatar Sep 08 '20 14:09 DmitruMoth

This is a well documented issue with SFML vertex arrays, rather than the map loader itself. This post has some details why it happens: https://en.sfml-dev.org/forums/index.php?topic=15338.0 (or just search for SFML tile tearing)

A good solution I've found is to render the map with a shader, like this https://github.com/SFML/SFML/wiki/Source%3A-ShaderTileMap

fallahn avatar Sep 08 '20 14:09 fallahn

How can i implement this to existing sfml demo?

DmitruMoth avatar Sep 08 '20 14:09 DmitruMoth

Short answer: not easily, it would pretty much be a re-write. The example is really just that: an example. Have you tried some of the suggested solutions in the forum topic, such as rounding your view's position to the neareset whole pixel? You could also render the visible set of chunks to a render texture first, then use that to make a sprite which you can scroll.

fallahn avatar Sep 08 '20 15:09 fallahn

Thanks, i will try to fix this problem p.s. rounding make it worse

DmitruMoth avatar Sep 08 '20 15:09 DmitruMoth