ID3DXPRTEngine::ComputeDirectLightingSHAdaptive

Computes the direct lighting contribution to 3D objects where the source radiance is represented by a spherical harmonic (SH) approximation, using adaptive sampling. This method generates new vertices and faces on the mesh to more accurately approximate the precomputed radiance transfer (PRT) signal.

HRESULT ComputeDirectLightingSHAdaptive(
  UINT Order,
  FLOAT AdaptiveThresh,
  FLOAT MinEdgeLength,
  UINT MaxSubdiv,
  LPD3DXPRTBUFFER pDataOut
);

Parameters

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.
AdaptiveThresh
[in] Threshold on the PRT vector to use for subdividing mesh vertices and faces. If less than 1e-6f, a default value of 1e-6f is specified.
MinEdgeLength
[in] Minimum face edge length that will be generated in adaptive sampling. If the method determines that the value is too small, a model-dependent value is specified. If zero, a default value of 4 is specified.
MaxSubdiv
[in] Maximum level of subdivision of a face that will be used in adaptive sampling.
pDataOut
[in, out] Pointer to an output ID3DXPRTBuffer object. 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.

Requirements

Header: Declared in D3dx9mesh.h.

See Also

ID3DXPRTEngine::RobustMeshRefine