Since this is related to the same issue I thought I would post it here. I originally thought I had solved my problem because the diagonals were smoothed just fine. However, we recently added in a grass texture, and with smoothing on, I get a white border on the outside of the grass, as well as an obvious line between the tiles, which should fit perfectly.
If I remove the half-pixel addition to each size of a tile that was recommended earlier in this thread, the line between the tiles is now gone, but all of the grass now has a white border (and the tiny lines of pixels that jut out from the OP return).
To avoid the jutting pixels and the white grass tips, I turn smoothing off. Both of these issues are gone, but my original problem now remains. The diagonals are once again adding extra pixels, creating a jagged look. Another but also came up, which adds/removes single lines of pixels when i move around. I have highlighted both issues in the image. The vertical line of pixels is tough to see, but its a brown line that has been added to the bottom image. This can be avoided if I implement the solution from earlier, except instead of .5 extra pixels around each tile, I add an entire pixel. This of course adds the line between the grass and the floor again, and causes a bunch of other issues.
In case it comes up, I am rounding my view coordinates to an integer, so that is not the issue. The resolution I am using on my view is 1920, 1080. When I zoom in far enough on the issues in the last image, they both go away. Note sure if that helps. My current code for drawing my tiles is:
for( int tx = leftTile; tx < rightTile; ++tx )
{
for( int ty = topTile; ty < bottomTile; ++ty )
{
if( staticTileSets[tx][ty] != NULL )
{
int tc = ((tx - leftTile) + (ty - topTile) * viewHalfWidthTiles * 2) * 4;
VertexArray &map = *(texVertexMap[staticTileSets[tx][ty]->texture]);
// define the position of the 4 points of the current tile
map[tc + 0].position = sf::Vector2f((tx + 0) * tileSize, (ty + 0) * tileSize);
map[tc + 1].position = sf::Vector2f((tx + 0) * tileSize, (ty + 1) * tileSize);
map[tc + 2].position = sf::Vector2f((tx + 1) * tileSize, (ty + 1) * tileSize);
map[tc + 3].position = sf::Vector2f((tx + 1) * tileSize, (ty + 0) * tileSize);
// define the texture coordinates of the 4 points of the current tile
float blend = .5f;
int ix = staticTileSets[tx][ty]->GetSubRect( staticLocalID[tx][ty] ).left / tileSize; // X index of the tile in the tileset
int iy = staticTileSets[tx][ty]->GetSubRect( staticLocalID[tx][ty] ).top / tileSize; // Y index of the tile in the tileset ;
map[tc+ 0].texCoords = sf::Vector2f((ix + 0) * tileSize + blend, (iy + 0) * tileSize + blend);
map[tc+ 1].texCoords = sf::Vector2f((ix + 0) * tileSize + blend, (iy + 1) * tileSize - blend);
map[tc+ 2].texCoords = sf::Vector2f((ix + 1) * tileSize - blend, (iy + 1) * tileSize - blend);
map[tc+ 3].texCoords = sf::Vector2f((ix + 1) * tileSize - blend, (iy + 0) * tileSize + blend);
}
else
{
}
}
}
for( std::map<sf::Texture*, sf::VertexArray*>::iterator mapIt = texVertexMap.begin();
mapIt != texVertexMap.end(); ++mapIt )
{
window->draw( *(*mapIt).second, (*mapIt).first );
}