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

ID3DXPRTEngine::ComputeDirectLightingSH Method


Computes the direct lighting contribution to 3-D objects where the source radiance is represented by a spherical harmonic (SH) approximation.

Syntax

HRESULT ComputeDirectLightingSH(      

    UINT Order,     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.
pDataOut
[in, out] Pointer to an output ID3DXPRTBuffer object that models the direct lighting contribution with the SH approximation. 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.


Remarks

The output does not include albedo, and only incoming light is integrated in the simulator. By not multiplying the albedo, you can model albedo variation at a finer scale than the source radiance, thereby yielding more accurate results from compression.

Call ID3DXPRTEngine::MultiplyAlbedo to multiply each precomputed radiance transfer (PRT) vector by the albedo.



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