![]() |
![]() |
![]() |
The ID3DXPRTEngine interface is used to compute a precomputed radiance transfer (PRT) simulation. Its methods are typically used offline, to compute per-vertex or per-texel transfer vectors in advance of real-time 3-D modeling.
ID3DXPRTEngine Members
ComputeBounce Computes the source radiance resulting from a single bounce of interreflected light. This method can be used for any lit scene, including a spherical harmonic (SH)-based PRT model. ComputeBounceAdaptive 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 PRT signal. This method can be used for any lit scene, including a SH-based PRT model. ComputeConvCoeffs Computes convolution coefficients relative to per-sample normal vectors to minimize the least-squares error with respect to input PRT data. The convolution coefficients can be used with skinned or transformed normals to model global effects on dynamic objects. ComputeDirectLightingSH Computes the direct lighting contribution to 3-D objects where the source radiance is represented by a SH approximation. ComputeDirectLightingSHAdaptive Computes the direct lighting contribution to 3-D objects where the source radiance is represented by a SH approximation, using adaptive sampling. This method generates new vertices and faces on the mesh to more accurately approximate the PRT signal. ComputeDirectLightingSHGPU Uses the graphics processing unit (GPU) to compute the direct lighting contribution to 3-D objects where the source radiance is represented by a SH approximation. Computing the lighting on the GPU will generally be much faster than on the CPU. ComputeSS Computes the source radiance resulting from subsurface scattering, using material properties set by ID3DXPRTEngine::SetMeshMaterials. This method can be used only for materials defined per-vertex in a mesh object. ComputeVolumeSamples Computes a projection of the direct lighting from the previous light bounce into SH basis vectors that represent incident radiance at specified locations. ComputeVolumeSamplesDirectSH Computes a projection of distant lighting into SH basis vectors that represent incident radiance at specified locations. ExtractPerVertexAlbedo Copies per-vertex albedo values from a mesh. FreeBounceData Frees memory used for temporary bounced-light simulation data. FreeSSData Frees memory used for temporary subsurface light scattering simulation data. GetAdaptedMesh Returns a mesh with modifications resulting from adaptive spatial sampling. The returned mesh contains only positions, normals, and texture coordinates (if defined). GetNumFaces Retrieves the number of faces in the mesh, including any new faces added as a result of adaptive spatial sampling. GetNumVerts Retrieves the number of vertices in the mesh, including any new vertices added as a result of adaptive spatial sampling. GetVertexAlbedo Retrieves albedo values of the mesh vertices. MultiplyAlbedo Multiplies each PRT vector by the per-vertex albedo. ResampleBuffer Resamples an input ID3DXPRTBuffer buffer and saves it to an output buffer. This method can be used to convert a vertex buffer to a texture buffer and vice-versa. It can also be used to convert single-channel buffers to 3-channel buffers and vice-versa. RobustMeshRefine Subdivides faces on a mesh, allowing for conservative adaptive sampling that will not eliminate features on the mesh. ScaleMeshChunk Scales all the samples associated with a given submesh. The method is useful for computing subsurface scattering. SetCallBack Sets a pointer to an optional callback function that computes the percentage of SH computations completed and gives the caller the option of aborting the simulator. SetMeshMaterials Sets mesh material properties in the 3-D scene. Use this method to specify subsurface scattering parameters. SetPerTexelAlbedo Sets an albedo value for each texel, overwriting previous albedo values. SetPerTexelNormal Sets a normal vector for each texel in a texture object. This method is used to store vertex normal vectors from a mesh (or interpolated vertex normals if pixel-based PRT is being computed). SetPerVertexAlbedo Sets an albedo value for each mesh SetSamplingInfo Sets sampling properties used by the PRT simulator.
Remarks
To convert from RGB to luminance values, the following formula is used:
Luminance = R * 0.2125 + G * 0.7154 + B * 0.0721The ID3DXPRTEngine interface is obtained by calling the D3DXCreatePRTEngine function.
The LPD3DXPRTENGINE type is defined as a pointer to the ID3DXPRTEngine interface.
typedef interface ID3DXPRTEngine ID3DXPRTEngine; typedef interface ID3DXPRTEngine *LPD3DXPRTENGINE;
Interface Information
Stock Implementation d3d9.dll Custom Implementation No Inherits from IUnknown Header d3dx9mesh.h Import library d3dx9.lib Minimum operating systems Windows 98
See Also
D3DXCreatePRTEngine