D3DXSHProjectCubeMap

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

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

Parameters

Order
[in] Order of the spherical harmonic (SH) evaluation. Must be in the range of D3DXSH_MINORDER to D3DXSH_MAXORDER, inclusive. The evaluation generates Order2 coefficients. The degree of the evaluation is Order - 1.
pCubeMap
[in] Pointer to a source cube texture. See IDirect3DCubeTexture9.
pROut
[in] Pointer to the output SH vector for the red component.
pGOut
[in] Pointer to the output SH vector for the green component.
pBOut
[in] Pointer to the output SH vector for the blue component.

Return Values

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

Requirements

Header: Declared in D3dx9math.h.

See Also

Precomputed Radiance Transfer