1
\$\begingroup\$

The GenerateMips method in the ID3D11DeviceContext allows generation of mipmaps at runtime, which is fine for fully opaque textures. However, when this method is used with transparent textures that do not have premultiplied alpha, the resulting mip levels tend to have black outlines at the transparency edges. For instance, this PNG texture, loaded through WIC and processed with GenerateMips, produces mipmaps with edge pixels that are way too dark:

Full size transparent PNG Resulting Mip Level 2

My question: Is there any way to specify to that this texture uses non-premultiplied alpha, so that DirectX can generate more correct mip levels?

\$\endgroup\$
  • 2
    \$\begingroup\$ The details of GenerateMips is left to the driver writer, so you will get variable quality out of it. Is there some reason why you can't generate the mips offline? How about using WIC? See DirectXTex. \$\endgroup\$ – Chuck Walbourn Jan 19 '15 at 4:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.