D3DXSHMultiply2 function (D3dx9math.h)


The D3DX (D3DX 9, D3DX 10, and D3DX 11) utility library is deprecated and is not supported for Windows Store apps.


Instead of using this function, we recommend that you use the Spherical Harmonics Math library function XMSHMultiply2, XMSHMultiply3, XMSHMultiply4, XMSHMultiply5, or XMSHMultiply6.

Computes the product of two functions represented using SH (f and g).


FLOAT* D3DXSHMultiply2(
  _In_       FLOAT *pOut,
  _In_ const FLOAT *pF,
  _In_ const FLOAT *pG


pOut [in]

Type: FLOAT*

Pointer to the output SH coefficients - basis function Ylm is stored at l*l + m+l.

pF [in]

Type: const FLOAT*

Input SH coeffs for first function.

pG [in]

Type: const FLOAT*

Second set of input SH coeffs.

Return value

Type: FLOAT*

Pointer to SH output coefficients.


The order is a number between 2 and 6 inclusive. So this page actually documents several functions: D3DXSHMultiply2, D3DXSHMultiply3, ... D3DXSHMultiply6.

Computes the product of two functions represented using SH (f and g), where pOut[i] = int(y_i(s) * f(s) * g(s)), where y_i(s) is the ith SH basis function, f(s) and g(s) are SH functions (sum_i(y_i(s)*c_i)). The order O determines the lengths of the arrays, where there should always be O^2 coefficients. In general the product of two SH functions of order O generates an SH function of order 2*O - 1, but the results are truncated. This means that the product commutes (f*g == g*f) but doesn't associate (f*(g*h) != (f*g)*h.


Requirement Value

See also

Math Functions