I think you did something wrong, it's not expected, especially if it's slower than rendering sprites.
Oh, please excuse my bloody idiocity, it seems I forgot to put the breaks in my cases and ended up rendering 96 times more geometry *facepalm*
I'm still getting this weird triangle cut off from a side of every tile.
Maybe you could check what I'm doing wrong
//using a generated terrain field[][] with values from 0 to 24
//creating/initing the vertexArray:
sf::VertexArray vertarr(sf::PrimitiveType::Quads);
for (int x = 0; x< terrx; ++x)
for (int y=0; y< terry; ++y)
{
if (field[x][y] != 0)
{
switch (field[x][y])
{
case 1:
vertarr.append(sf::Vertex(sf::Vector2f(8*x, 8*y), sf::Vector2f(0,0)));
vertarr.append(sf::Vertex(sf::Vector2f(8*x+8, 8*y), sf::Vector2f(8,0)));
vertarr.append(sf::Vertex(sf::Vector2f(8*x, 8*y+8), sf::Vector2f(0,8)));
vertarr.append(sf::Vertex(sf::Vector2f(8*x+8, 8*y+8), sf::Vector2f(8,8)));
break;
case 2:
vertarr.append(sf::Vertex(sf::Vector2f(8*x, 8*y), sf::Vector2f(0,8)));
vertarr.append(sf::Vertex(sf::Vector2f(8*x+8, 8*y), sf::Vector2f(8,8)));
vertarr.append(sf::Vertex(sf::Vector2f(8*x, 8*y+8), sf::Vector2f(0,16)));
vertarr.append(sf::Vertex(sf::Vector2f(8*x+8, 8*y+8), sf::Vector2f(8,16)));
break;
case 3:
vertarr.append(sf::Vertex(sf::Vector2f(8*x, 8*y), sf::Vector2f(0,16)));
vertarr.append(sf::Vertex(sf::Vector2f(8*x+8, 8*y), sf::Vector2f(8,16)));
vertarr.append(sf::Vertex(sf::Vector2f(8*x, 8*y+8), sf::Vector2f(0,24)));
vertarr.append(sf::Vertex(sf::Vector2f(8*x+8, 8*y+8), sf::Vector2f(8,24)));
break;
case 4:
vertarr.append(sf::Vertex(sf::Vector2f(8*x, 8*y), sf::Vector2f(8,0)));
vertarr.append(sf::Vertex(sf::Vector2f(8*x+8, 8*y), sf::Vector2f(16,0)));
vertarr.append(sf::Vertex(sf::Vector2f(8*x, 8*y+8), sf::Vector2f(8,8)));
vertarr.append(sf::Vertex(sf::Vector2f(8*x+8, 8*y+8), sf::Vector2f(16,8)));
break;
[...]
case 24:
vertarr.append(sf::Vertex(sf::Vector2f(8*x, 8*y), sf::Vector2f(56,16)));
vertarr.append(sf::Vertex(sf::Vector2f(8*x+8, 8*y), sf::Vector2f(64,16)));
vertarr.append(sf::Vertex(sf::Vector2f(8*x, 8*y+8), sf::Vector2f(56,24)));
vertarr.append(sf::Vertex(sf::Vector2f(8*x+8, 8*y+8), sf::Vector2f(64,24)));
break;
}
}
}
//Then in the while rendering with
Window.draw(vertarr,sf::RenderStates(&mud));
The one I mentioned above, so that you could use the src alpha as a mask.
Source alpha is used as a mask in BlendAlpha.
No I mean like (GL_ZERO, GL_ONE_MINUS_SCR_ALPHA), basically the texture would be used as a hole-cutter
Like the 3rd example here
http://www.machwerx.com/2009/02/11/glblendfunc/