Jump to content

  • Log In with Google      Sign In   
  • Create Account

#Actualjajcek

Posted 31 December 2012 - 03:00 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.

#3jajcek

Posted 31 December 2012 - 02:59 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.

#2jajcek

Posted 31 December 2012 - 02:59 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.

#1jajcek

Posted 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, so it means that it finally works.


PARTNERS