I got a few questions regarding samplers objects in directx 11.
I have the following kind of textures that needs to be sampled:
- 3D model texture2d (diffuse, normal textures)
- GBuffer texture2d (position, diffuse, normals)
- Depth texture2d
- Depth textureCube
This is how I create my (so far only) sampler:
D3D11_SAMPLER_DESC samplerDesc;
ZeroMemory(&samplerDesc, sizeof(D3D11_SAMPLER_DESC));
samplerDesc.Filter = D3D11_FILTER_ANISOTROPIC;
samplerDesc.AddressU = D3D11_TEXTURE_ADDRESS_WRAP;
samplerDesc.AddressV = D3D11_TEXTURE_ADDRESS_WRAP;
samplerDesc.AddressW = D3D11_TEXTURE_ADDRESS_WRAP;
samplerDesc.MaxAnisotropy = anisotropic; // typically 16
samplerDesc.ComparisonFunc = D3D11_COMPARISON_ALWAYS;
samplerDesc.MaxLOD = D3D11_FLOAT32_MAX;
DXCALL(mDevice->CreateSamplerState(&samplerDesc, &mTextureSampler));
1. Up untill now, I have sampled the 3d model textures AND GBuffer textures using the same sampler, even though the 3d model textures are mipmapped and the gbuffers are not - and it works, not even any dxgi warnings. How can this be? Shouldnt the gbuffer textures be wrong if they are not mipmapped, yet sampled by a mipmap sampler?
2. Which leads me to the following question, if the first two can be sampled using the same sampler, can I also use it for depth 2d and cubemap textures?