I'm trying to texture my procedurally generated terrain. Previously I used an array of textures e.g.
Texture tex, however in the shader you can't access this by index unless you chain if statements (ew), so I switched to using a
Texture2DArray where instead you use a 3D UV where the Z component is the texture index. I use texassemble to generate a DDS file containing the Texture2DArray so it can be loaded in with ease.
For whatever reason, DirectX(11) seems to interpolate the Z component whenever the Z changes, resulting in seeing a slice of other textures in the array. I should add I'm trying to change the texture on the same piece of geometry. But I need to do this due to having multiple procedurally generated biomes.
I sample the texture in the pixel shader like so
float4 texCol = Tex.Sample(Sampler, v.UV);
My sampler is set up like this
CD3D11_SAMPLER_DESC samplerDesc(D3D11_FILTER_ANISOTROPIC, D3D11_TEXTURE_ADDRESS_WRAP, D3D11_TEXTURE_ADDRESS_WRAP, D3D11_TEXTURE_ADDRESS_CLAMP, 0.f, maxAnisotropy, D3D11_COMPARISON_NEVER, border, 0.f, FLT_MAX);
The unwanted interpolation in question