d3d9.dllComputeDirectLightingSHAdaptive
Microsoft DirectX 9.0 SDK Update (October 2004)

ID3DXPRTEngine::ComputeDirectLightingSHAdaptive Method


Computes the direct lighting contribution to 3-D 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.

Syntax

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 Value

If the method succeeds, the return value is D3D_OK.

If the method fails, the return value can be one of the following:

D3DERR_INVALIDCALLThe method call is invalid. For example, a method's parameter may have an invalid value.
E_OUTOFMEMORYMicrosoft Direct3D could not allocate sufficient memory to complete the call.


See Also

ID3DXPRTEngine::RobustMeshRefine


© 2004 Microsoft Corporation. All rights reserved.
Feedback? Please provide us with your comments on this topic.
For more help, visit the DirectX Developer Center.