ID3DXPRTEngine::ComputeBounceAdaptive method

Computes the source radiance resulting from a single bounce of interreflected light, using adaptive sampling. This method generates new vertices and faces on the mesh to more accurately approximate the precomputed radiance transfer (PRT) signal. This method can be used for any lit scene, including a spherical harmonic (SH)-based PRT model.

Syntax

HRESULT ComputeBounceAdaptive(
  [in]      LPD3DXPRTBUFFER pDataIn,
  [in]      FLOAT           AdaptiveThresh,
  [in]      FLOAT           MinEdgeLength,
  [in]      UINT            MaxSubdiv,
  [in, out] LPD3DXPRTBUFFER pDataOut,
  [in, out] LPD3DXPRTBUFFER pDataTotal
);

Parameters

pDataIn [in]

Type: LPD3DXPRTBUFFER

Pointer to an input ID3DXPRTBuffer object that represents the 3D object from the previous light bounce. This input buffer must have the proper number of color channels allocated for the simulation.

AdaptiveThresh [in]

Type: FLOAT

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]

Type: FLOAT

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]

Type: UINT

Maximum level of subdivision of a face that will be used in adaptive sampling.

pDataOut [in, out]

Type: LPD3DXPRTBUFFER

Pointer to an output ID3DXPRTBuffer object. This output buffer must have the proper number of color channels allocated for the simulation.

pDataTotal [in, out]

Type: LPD3DXPRTBUFFER

Pointer to an optional ID3DXPRTBuffer object that keeps a running sum of pDataOut with each light bounce computation. May be NULL.

Return value

Type: HRESULT

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

Requirement Value
Header
D3DX9Mesh.h
Library
D3dx9.lib

See also

ID3DXPRTEngine

ID3DXPRTEngine::RobustMeshRefine