Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

jajcek

Member Since 13 Aug 2010
Offline Last Active Today, 02:27 AM
-----

#5016010 Generating mipmaps automatically

Posted by jajcek on 31 December 2012 - 02:57 AM

Thank you for your answer. I have finally solved it an I thought that it will be good to share this to others that are using DirectXTK.
The DirectXTK has another function:

HRESULT CreateDDSTextureFromFileEx( _In_ ID3D11Device* d3dDevice,
                                        _In_z_ const wchar_t* szFileName,
                                        _In_ size_t maxsize,
                                        _In_ D3D11_USAGE usage,
                                        _In_ unsigned int bindFlags,
                                        _In_ unsigned int cpuAccessFlags,
                                        _In_ unsigned int miscFlags,
                                        _In_ bool forceSRGB,
                                        _Out_opt_ ID3D11Resource** texture,
                                        _Out_opt_ ID3D11ShaderResourceView** textureView
                                    );

to this function I can pass the required flags, as you said the D3D11_BIND_RENDER_TARGET and the D3D11_RESOURCE_MISC_GENERATE_MIPS.

I have created a DDS with custom mipmaps that differs a lot from the original picture, so I could clearly see that on a terrain. When I called GenerateMips the mipmaps from DDS has been hid by the generated ones (I think so :D), so it means that it finally works.


PARTNERS