ID3DXPRTEngine interface

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 3D modeling.

Members

The ID3DXPRTEngine interface inherits from the IUnknown interface. ID3DXPRTEngine also has these types of members:

Methods

The ID3DXPRTEngine interface has these methods.

Method Description
ClosestRayIntersects Uses efficient ray-tracing in precomputed radiance transfer (PRT) simulations to determine whether a ray intersects a mesh. If an intersection is found, the method returns the index of the closest mesh face hit by the ray and the barycentric coordinates of the intersection point.
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 precomputed radiance transfer (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 precomputed radiance transfer (PRT) signal. This method can be used for any lit scene, including a spherical harmonic (SH)-based PRT model.
ComputeDirectLightingSH Computes the direct lighting contribution to 3D objects where the source radiance is represented by a spherical harmonic (SH) approximation.
ComputeDirectLightingSHAdaptive Computes the direct lighting contribution to 3D objects where the source radiance is represented by a spherical harmonic (SH) approximation, using adaptive sampling. This method generates new vertices and faces on the mesh to more accurately approximate the precomputed radiance transfer (PRT) signal.
ComputeDirectLightingSHGPU Uses the GPU to compute the direct lighting contribution to 3D objects where the source radiance is represented by a spherical harmonic (SH) approximation. Computing the lighting on the GPU will generally be much faster than on the CPU.
ComputeLDPRTCoeffs Computes locally-deformable precomputed radiance transfer (LDPRT) coefficients relative to per-sample normal vectors to minimize the least-squares error with respect to input ID3DXPRTBuffer data. These coefficients can be used with skinned or transformed normal vectors to model global effects on dynamic objects.
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.
ComputeSSAdaptive Computes a transfer vector that maps source radiance to exit radiance resulting from subsurface scattering, using adaptive sampling and material properties set by ID3DXPRTEngine::SetMeshMaterials. The method generates new vertices and faces on the mesh to more accurately approximate the precomputed radiance transfer (PRT) signal. This method can be used only for materials defined per-vertex in a mesh object.
ComputeSurfSamplesBounce Computes precomputed radiance transfer (PRT) samples for an arbitrary point (and normal vector).
ComputeSurfSamplesDirectSH Computes, at an arbitrary point not on a mesh, a transfer vector that maps source radiance (represented by a spherical harmonic (SH) approximation) to exit radiance.
ComputeVolumeSamples Computes a projection of the direct lighting from the previous light bounce into spherical harmonic (SH) basis vectors that represent incident radiance at specified locations.
ComputeVolumeSamplesDirectSH Computes a projection of distant lighting into spherical harmonic (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 precomputed radiance transfer (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 spherical harmonic (SH) computations completed and gives the caller the option of aborting the simulator.
SetMeshMaterials Sets mesh material properties in the 3D scene. Use this method to specify subsurface scattering parameters.
SetMinMaxIntersection Sets the minimum and maximum distances of intersection between 3D objects. These distance values can be used to control the minimum or maximum distance that objects can shadow or reflect light. For example, the method can be used to limit the shadowing of nearby features of a 3D model.
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 precomputed radiance transfer (PRT) is being computed).
SetPerVertexAlbedo Sets an albedo value for each mesh vertex, overwriting previous albedo values.
SetSamplingInfo Sets sampling properties used by the precomputed radiance transfer (PRT) simulator.
ShadowRayIntersects Uses efficient ray-tracing in precomputed radiance transfer (PRT) simulations to determine whether a ray intersects a mesh. Typically used to determine whether a given point is in shadow.

 

Remarks

To convert from RGB to luminance values, the following formula is used:

Luminance = R * 0.2125 + G * 0.7154 + B * 0.0721

The 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;

Requirements

Requirement Value
Header
D3DX9Mesh.h
Library
D3dx9.lib

See also

D3DX Interfaces

D3DXCreatePRTEngine

Precomputed Radiance Transfer (Direct3D 9)