SFML community forums
Help => Graphics => Topic started by: maassk on July 15, 2018, 06:10:59 pm
-
Hi,
I took the code from this official tutorial (tile map example): https://www.sfml-dev.org/tutorials/2.5/graphics-vertex-array.php (https://www.sfml-dev.org/tutorials/2.5/graphics-vertex-array.php)
I manipulated a little bit only the part defining quad 4 corners position , so now i have polygons shapes instead of perfect squares. To be more precise, i just skewed each tile.
(i didnt change this part defining textures coordinates).
Now i see that there is a problem with mapping textures. Left and right bound of my polygon tile takes additional 1 pixel from textures on the left and on the right in my tileset png image. So if nearest tiles have very different colors, it looks like having a borders on the left and right.
My texture is 320x32 pixels png image (only 1 row with 10 tiles 32x32).
Please give me any clues why it takes this additional pixels.
-
As a temporary solution i had to remake all of my tiles to 34x32 (added 2 collumns of pixels, one on the bigining and one at the end of each tile. Then i had to copy "old" first and last column of pixels to them).
Dunno why skewed lines take pixels outside of the location i indicated in texture.
Any ideas?
-
I don't see any images if you attached them. Also, post your code.
-
I don't know if this is the case but it sounds like one of those times where OpenGL choosing which pixel to choose could be either 1 of two.
If all of your tiles are skewed all the time, why not use actual skewed textures too? It would likely be easier to edit the tiles since you see the as they are displayed and might fix this to boot.