ID3DXPRTEngine::ComputeVolumeSamples

Computes a projection of the direct lighting from the previous light bounce into spherical harmonic (SH) basis vectors that represent incident radiance at specified locations.

HRESULT ComputeVolumeSamples(
  LPD3DXPRTBUFFER pSurfDataIn,
  UINT Order,
  UINT NumVolSamples.xml,
  CONST D3DXVECTOR3 * pSampleLocs,
  LPD3DXPRTBUFFER pDataOut
);

Parameters

pSurfDataIn
[in] Pointer to an input ID3DXPRTBuffer object that represents the 3D object from the previous light bounce.
Order
[in] Order of the 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.
NumVolSamples.xml
[in] Number of sample locations.
pSampleLocs
[in] Position for each sample. If pSampleLocs is NULL, ComputeVolumeSamples will compute transfer matrices at every mesh vertex. However, if pSampleLocs is not NULL, you must sample over a sphere (set UseSphere = TRUE and UseCosine = FALSE in ID3DXPRTEngine::SetSamplingInfo); otherwise, ComputeVolumeSamples will return D3DERR_INVALIDCALL.
pDataOut
[in, out] Pointer to an output ID3DXPRTBuffer object that projects the direct lighting from the previous light bounce into SH basis vectors. This buffer must have the proper number of color channels allocated for the simulation.

Return Values

If the method succeeds, the return value is D3D_OK. If the method fails, the return value can be one of the following: D3DERR_INVALIDCALL, E_OUTOFMEMORY.

Remarks

This method computes how the light from the source radiance function is reflected off the surface that represents the scene (pSurfDataIn) and arrives at each point in space specified by pSampleLocs. The SH coefficients represent the mapping, at each pSampleLocs point, of source radiance to transferred incident radiance.

Requirements

Header: Declared in D3dx9mesh.h.

See Also

ID3DXPRTEngine::ComputeVolumeSamplesDirectSH