D3DXSHProjectCubeMap function

Projects a function represented on a cube map into spherical harmonics (SH).

Syntax

HRESULT D3DXSHProjectCubeMap(
  _In_ UINT                   Order,
  _In_ LPDIRECT3DCUBETEXTURE9 pCubeMap,
  _In_ FLOAT                  *pROut,
  _In_ FLOAT                  *pGOut,
  _In_ FLOAT                  *pBOut
);

Parameters

Order [in]

Type: UINT

Order of the spherical harmonic (SH) evaluation. Must be in the range of D3DXSH_MINORDER to D3DXSH_MAXORDER, inclusive. The evaluation generates OrderĀ² coefficients. The degree of the evaluation is Order - 1.

pCubeMap [in]

Type: LPDIRECT3DCUBETEXTURE9

Pointer to a source cube texture. See IDirect3DCubeTexture9.

pROut [in]

Type: FLOAT*

Pointer to the output SH vector for the red component.

pGOut [in]

Type: FLOAT*

Pointer to the output SH vector for the green component.

pBOut [in]

Type: FLOAT*

Pointer to the output SH vector for the blue component.

Return value

Type: HRESULT

If the function succeeds, the return value is D3D_OK. If the function fails, the return value can be: D3DERR_INVALIDCALL.

Requirements

Requirement Value
Header
D3dx9math.h
Library
D3dx9.lib

See also

Math Functions

Precomputed Radiance Transfer (Direct3D 9)