locked
Windows Phone 8 D3D11 Mip mapping sample code

    Question

  • Hi there, is there any sample code around showing how to create and render a mip mapped texture.

    So far I've attempted to set the texture filter in the sampler to D3D11_FILTER_MIN_LINEAR_MAG_POINT_MIP_LINEAR, and set the MipLevels in the texture description for CreateTexture2D to 0, but I get an exception when I do this.

    Is there any more flags I need to set or functions I need to call when creating/using a mip mapped texture.

    Thanks


    • Edited by Playir Wednesday, November 26, 2014 11:56 PM
    Wednesday, November 26, 2014 11:56 PM

Answers

  • Ok, this is what I was missing in case anyone else out there runs into problems.

    Call CreateTexture2D with no pIniitalData.
    Make sure your texture description MiscFlag = D3D11_RESOURCE_MISC_GENERATE_MIPS

    Set the data instead with an updateSubresources.

    Then make a call to GenerateMips.

    • Marked as answer by Playir Thursday, November 27, 2014 1:08 AM
    Thursday, November 27, 2014 1:07 AM

All replies

  • Ok, this is what I was missing in case anyone else out there runs into problems.

    Call CreateTexture2D with no pIniitalData.
    Make sure your texture description MiscFlag = D3D11_RESOURCE_MISC_GENERATE_MIPS

    Set the data instead with an updateSubresources.

    Then make a call to GenerateMips.

    • Marked as answer by Playir Thursday, November 27, 2014 1:08 AM
    Thursday, November 27, 2014 1:07 AM
  • Hi Playir,

    I am glad to hear you have solved this problem. It’s really useful for other community members who has similar questions.

    Regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place. Click HERE to participate the survey.

    Thursday, November 27, 2014 3:40 AM
    Moderator