I'm working on a game with DirectX11 and I need to apply a mip mapping on my textures when they get far from the camera (I actually have a menu with a lot of textures far from the camera and the mip mapping doesn't seem to be applied because the framerate is quite low...)
I've searched for 3 days how I could do this and I found many solutions but none of them seems to work...
I have this piece of code that create a texture, and I can show you other pieces if required :
D3D11_TEXTURE2D_DESC textureDesc;
ZeroMemory( &textureDesc, sizeof(textureDesc) );
textureDesc.Width = width;
textureDesc.Height = height;
textureDesc.MipLevels = 1;
textureDesc.ArraySize = 1;
textureDesc.Format = DXGI_FORMAT_B8G8R8A8_UNORM;
textureDesc.SampleDesc.Count = 1;
textureDesc.Usage = D3D11_USAGE_DEFAULT;
textureDesc.BindFlags = D3D11_BIND_RENDER_TARGET | D3D11_BIND_SHADER_RESOURCE;
textureDesc.CPUAccessFlags = 0;
textureDesc.MiscFlags = D3D11_RESOURCE_MISC_GENERATE_MIPS;
When I try to change the MipLevels value to 0 or another value, I get an error...
My question is : What should I do to get the mip mapping to work ? Do you have any clue, any idea.
Sorry for my average english I'm french
Thanks a lot !