Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 13 Aug 2010
Offline Last Active Jul 30 2014 09:16 AM

#5094675 Binormal (probably) artifacts

Posted by on 17 September 2013 - 09:23 AM

Okay I have solved it, according to the http://mathworld.wolfram.com/BinormalVector.html , the binormal is cross(t, n), so I just changed the code to:


//x = cross( b, n );
b = cross( t, n );
b = normalize( b );
and it works.

#5016010 Generating mipmaps automatically

Posted by 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.