locked
How to diable mipmap in DirectX 11

    Question

  • I am develop the 2D game,
    so I didn't need mipmap, I want to disable that.

    Can you give me some sample code?

    Thursday, March 5, 2015 11:34 AM

Answers

  • When creating the texture, set the number of mipmap levels to 1 instead of 0.  See docs for D3D11_TEXTURE2D_DESC::MipLevels The default, 0, means to generate all mipmap levels.

    Also, set the sampler's filtering mode to something that doesn't use mipmapping.  Something of the form: D3D11_FILTER_xxxxxx_MIP_POINT.

     

    • Marked as answer by lihuipeng49 Friday, March 13, 2015 1:48 AM
    Thursday, March 5, 2015 3:23 PM

All replies

  • When creating the texture, set the number of mipmap levels to 1 instead of 0.  See docs for D3D11_TEXTURE2D_DESC::MipLevels The default, 0, means to generate all mipmap levels.

    Also, set the sampler's filtering mode to something that doesn't use mipmapping.  Something of the form: D3D11_FILTER_xxxxxx_MIP_POINT.

     

    • Marked as answer by lihuipeng49 Friday, March 13, 2015 1:48 AM
    Thursday, March 5, 2015 3:23 PM
  • Just don't provide mipmaps for your textures.  Are you using DDS files?

    This of course assumes you never scale your sprites and always ensure they are rendered at 1:1 pixel ratios.

    Thursday, March 5, 2015 8:21 PM
  • yes, I use the DDS files.

    Because I want to rendered at not 1:1 and use atlas image as source.
    So, I must disable the mipmap.

    Friday, March 13, 2015 1:29 AM