Microsoft DirectX 8.1 (C++) |
Converts a height map into a normal map. The (x,y,z) components of each normal are mapped to the (r,g,b) channels of the output texture.
HRESULT D3DXComputeNormalMap( LPDIRECT3DTEXTURE8 pTexture, LPDIRECT3DTEXTURE8 pSrcTexture, CONST PALETTEENTRY* pSrcPalette, DWORD Flags, DWORD Channel, FLOAT Amplitude );
If the function succeeds, the return value is D3D_OK.
If the function fails, the return value can be the following value.
D3DERR_INVALIDCALL |
This method computes the normal by using the central difference with a kernel size of 3×3. RGB channels in the destination contain biased (x,y,z) components of the normal.
Header: Declared in D3dx8tex.h.
Import Library: Use D3dx8.lib.