description | ms.assetid | title | ms.topic | ms.date | topic_type | api_name | api_type | api_location | ||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
D3DXComputeNormalMap function - 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. |
ed9053c0-b1df-4f74-bdee-627c0f60d942 |
D3DXComputeNormalMap function (D3dx9tex.h) |
reference |
05/31/2018 |
|
|
|
|
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(
_Out_ LPDIRECT3DTEXTURE9 pTexture,
_In_ LPDIRECT3DTEXTURE9 pSrcTexture,
_In_ const PALETTEENTRY *pSrcPalette,
_In_ DWORD Flags,
_In_ DWORD Channel,
_In_ FLOAT Amplitude
);
-
pTexture [out]
-
Type: LPDIRECT3DTEXTURE9
Pointer to an IDirect3DTexture9 interface, representing the destination texture.
-
pSrcTexture [in]
-
Type: LPDIRECT3DTEXTURE9
Pointer to an IDirect3DTexture9 interface, representing the source height-map texture.
-
pSrcPalette [in]
-
Type: const PALETTEENTRY*
Pointer to a PALETTEENTRY type that contains the source palette of 256 colors or NULL.
-
Flags [in]
-
Type: DWORD
One or more D3DX_NORMALMAP flags that control generation of normal maps.
-
Channel [in]
-
Type: DWORD
One D3DX_CHANNEL flag specifying the source of height information.
-
Amplitude [in]
-
Type: FLOAT
Constant value multiplier that increases (or decreases) the values in the normal map. Higher values usually make bumps more visible, lower values usually make bumps less visible.
Type: HRESULT
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 3x3. The central differencing denominator used is 2.0. RGB channels in the destination contain biased (x,y,z) components of the normal.
Requirement | Value |
---|---|
Header |
|
Library |
|