So i am trying to render a small isometric tile-map and just started with a single tile to feel the thing out. But i am running into a problem where if the tile gets jagged edges, even though it looks ok on the texture itself. The strange thing is that it also appears to be right if i use the Graphics Debugger in Visual Studio (And that is because it tile gets displayed a little smaller than the real one - slighty zooming in has the same effect). Here is a picture to better visualize what i mean:
The left picture is a part of the rendered frame inside a normal window. The right part is the captured frame for the graphics debugging tool. As you can see the display for the captured frame looks completely ok. The normal rendering inside a window also starts to look good if i scale this tile up by some factor.
Here is my Sampler Desc. I am creating the texture by using the CreateDDSTextureFromFilemethod provided by the DirectXTK (https://github.com/Microsoft/DirectXTK).
CreateDDSTextureFromFile(gfx->GetGraphicsDevice()->GetDevice(), L"resources/tile.DDS", nullptr, shaderResource.GetAddressOf())
ZeroMemory(&g_defaultSamplerDesc, sizeof(D3D11_SAMPLER_DESC));
g_defaultSamplerDesc.Filter = D3D11_FILTER_MIN_MAG_MIP_LINEAR; //D3D11_FILTER_MIN_LINEAR_MAG_POINT_MIP_LINEAR
g_defaultSamplerDesc.AddressU = D3D11_TEXTURE_ADDRESS_WRAP;
g_defaultSamplerDesc.AddressV = D3D11_TEXTURE_ADDRESS_WRAP;
g_defaultSamplerDesc.AddressW = D3D11_TEXTURE_ADDRESS_WRAP;
g_defaultSamplerDesc.ComparisonFunc = D3D11_COMPARISON_NEVER;
g_defaultSamplerDesc.MinLOD = 0;
g_defaultSamplerDesc.MaxAnisotropy = 1;
g_defaultSamplerDesc.MaxLOD = D3D11_FLOAT32_MAX;
I checked the .dds file and there is only 1 Mip-Level. Here is also the Texture description which the DirectXTK method is using. Seems fine to me:
Width 64 unsigned int
Height 64 unsigned int
MipLevels 1 unsigned int
ArraySize 1 unsigned int
Format DXGI_FORMAT_B8G8R8A8_UNORM (87) DXGI_FORMAT
+ SampleDesc {Count=1 Quality=0 } DXGI_SAMPLE_DESC
Usage D3D11_USAGE_DEFAULT (0) D3D11_USAGE
BindFlags 8 unsigned int
CPUAccessFlags 0 unsigned int
MiscFlags 0 unsigned int
And for what it's worth here is also my Vertex-Setup:
Vertex v[] =
{
Vertex(-32.f, -32.f, 1.0f, 0.0f, 1.0f),
Vertex(-32.f, 32.f, 1.0f, 0.0f, 0.0f),
Vertex(32.0f, -32.f, 1.0f, 1.0f, 1.0f),
Vertex(32.0f, 32.f, 1.0f, 1.0f, 0.0f)
};
Any idea what might be causing this? This also happens with other dimetric textures.
Full disclosure: I also asked this question on stackoverflow, but since i have got no real reply (beside some nice help from one fella) for 5 days i am getting a bit desperate, especially because i already tried a lot of stuff. Here is the original question: http://stackoverflow.com/questions/36068768/isometric-tile-has-jagged-lines