Share via


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

Computes a projection of distant lighting into spherical harmonic (SH) basis vectors that represent incident radiance at specified locations.

Definition

Visual Basic Public Sub ComputeVolumeSamplesDirectSphericalHarmonics( _
    ByVal shOrderIn As Integer, _
    ByVal shOrder As Integer, _
    ByVal sampleLocations() As Vector3, _
    ByVal dataOut As PrtBuffer _
)
C# public void ComputeVolumeSamplesDirectSphericalHarmonics(
    int shOrderIn,
    int shOrder,
    Vector3[] sampleLocations,
    PrtBuffer dataOut
);
C++ public:
void ComputeVolumeSamplesDirectSphericalHarmonics(
    int shOrderIn,
    int shOrder,
    array<Vector3>^ sampleLocations,
    PrtBufferdataOut
);
JScript public function ComputeVolumeSamplesDirectSphericalHarmonics(
    shOrderIn : int,
    shOrder : int,
    sampleLocations : Vector3[],
    dataOut : PrtBuffer
);

Parameters

shOrderIn System.Int32
Order of the SH representation of distant lighting. Must be in the range of SphericalHarmonics.MinimumOrder to SphericalHarmonics.MaximumOrder, inclusive. The degree of the evaluation is shOrderIn - 1.
shOrder System.Int32
Order of the SH representation of local lighting. Must be in the range of SphericalHarmonics.MinimumOrder to SphericalHarmonics.MaximumOrder, inclusive. The degree of the evaluation is shOrder - 1.
sampleLocations Microsoft.DirectX.Vector3[]
An integer array that contains the position for each sample.
dataOut Microsoft.DirectX.Direct3D.PrtBuffer
A PrtBuffer object that projects the distant lighting into SH basis vectors. This buffer must have the proper number of color channels allocated for the simulation. This method generates shOrderIn2 * shOrder2 scalars per channel at each sample location.

Remarks

This method computes how light from a distant source arrives at each point in space specified by sampleLocations. The SH coefficients represent the mapping, at each sampleLocations point, of source radiance to transferred incident radiance.

To use this method successfully, you must set sampling over a sphere with the parameter isUsingSphere set to true and the parameter isUsingCosine set to false in a call to PrtEngine.SetSamplingInfo, otherwise an exception is thrown.

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.

See Also