Share via


PrtEngine.ComputeLDPrtCoefficients(PrtBuffer,Int32,Vector3[],PrtBuffer) Method (Microsoft.DirectX.Direct3D)

Computes locally-deformable precomputed radiance transfer (LDPRT) coefficients relative to per-sample normal vectors to minimize the least-squares error with respect to input PrtBuffer data. These coefficients can be used with skinned or transformed normal vectors to model global effects on dynamic objects.

Definition

Visual Basic Public Sub ComputeLDPrtCoefficients( _
    ByVal bufferIn As PrtBuffer, _
    ByVal shOrder As Integer, _
    ByVal normalData() As Vector3, _
    ByVal bufferOut As PrtBuffer _
)
C# public void ComputeLDPrtCoefficients(
    PrtBuffer bufferIn,
    int shOrder,
    Vector3[] normalData,
    PrtBuffer bufferOut
);
C++ public:
void ComputeLDPrtCoefficients(
    PrtBufferbufferIn,
    int shOrder,
    array<Vector3>^ normalData,
    PrtBufferbufferOut
);
JScript public function ComputeLDPrtCoefficients(
    bufferIn : PrtBuffer,
    shOrder : int,
    normalData : Vector3[],
    bufferOut : PrtBuffer
);

Parameters

bufferIn Microsoft.DirectX.Direct3D.PrtBuffer
A PrtBuffer object that represents the spherical harmonic (SH) precomputed radiance transfer (PRT) data.
shOrder System.Int32
Order of the SH evaluation. Must be in the range of SphericalHarmonics.MinimumOrder to SphericalHarmonics.MaximumOrder, inclusive. The evaluation generates shOrder2 coefficients. The degree of the evaluation is shOrder - 1.
normalData Microsoft.DirectX.Vector3[]
A Vector3 array to be filled with shader-optimal normal vectors for which LDPRT coefficients are optimized. This array must be the same size as the number of samples in bufferIn.
bufferOut Microsoft.DirectX.Direct3D.PrtBuffer
A PrtBuffer object that contains shOrder zonal harmonic coefficients per color channel per sample.

Remarks

Solutions for shading normal vectors can optionally be obtained with this method. These normal vectors, along with the LDPRT coefficients, can more accurately represent the PRT signal. In this case, the coefficients represent zonal harmonics oriented in the normal direction.

This method cannot be used with results from ComputeSurfSamplesBounce or ComputeSurfSamplesDirectSphericalHarmonics.

Exceptions

InvalidCallException

The method call is invalid. For example, a method's parameter might contain an invalid value.

OutOfMemoryExceptionLeave Site

Microsoft Direct3D could not allocate sufficient memory to complete the call.