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.
Method | Description |
---|---|
ID3DXPRTEngine::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. |
ID3DXPRTEngine::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. |
ID3DXPRTEngine::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. |
ID3DXPRTEngine::ComputeDirectLightingSH | Computes the direct lighting contribution to 3D objects where the source radiance is represented by a spherical harmonic (SH) approximation. |
ID3DXPRTEngine::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. |
ID3DXPRTEngine::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. |
ID3DXPRTEngine::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. |
ID3DXPRTEngine::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. |
ID3DXPRTEngine::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. |
ID3DXPRTEngine::ComputeSurfSamplesBounce | Computes precomputed radiance transfer (PRT) samples for an arbitrary point (and normal vector). |
ID3DXPRTEngine::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. |
ID3DXPRTEngine::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. |
ID3DXPRTEngine::ComputeVolumeSamplesDirectSH | Computes a projection of distant lighting into spherical harmonic (SH) basis vectors that represent incident radiance at specified locations. |
ID3DXPRTEngine::ExtractPerVertexAlbedo | Copies per-vertex albedo values from a mesh. |
ID3DXPRTEngine::FreeBounceData | Frees memory used for temporary bounced-light simulation data. |
ID3DXPRTEngine::FreeSSData | Frees memory used for temporary subsurface light scattering simulation data. |
ID3DXPRTEngine::GetAdaptedMesh | Returns a mesh with modifications resulting from adaptive spatial sampling. The returned mesh contains only positions, normals, and texture coordinates (if defined). |
ID3DXPRTEngine::GetNumFaces | Retrieves the number of faces in the mesh, including any new faces added as a result of adaptive spatial sampling. |
ID3DXPRTEngine::GetNumVerts | Retrieves the number of vertices in the mesh, including any new vertices added as a result of adaptive spatial sampling. |
ID3DXPRTEngine::GetVertexAlbedo | Retrieves albedo values of the mesh vertices. |
ID3DXPRTEngine::MultiplyAlbedo | Multiplies each precomputed radiance transfer (PRT) vector by the per-vertex albedo. |
ID3DXPRTEngine::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. |
ID3DXPRTEngine::RobustMeshRefine | Subdivides faces on a mesh, allowing for conservative adaptive sampling that will not eliminate features on the mesh. |
ID3DXPRTEngine::ScaleMeshChunk | Scales all the samples associated with a given submesh. The method is useful for computing subsurface scattering. |
ID3DXPRTEngine::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. |
ID3DXPRTEngine::SetMeshMaterials | Sets mesh material properties in the 3D scene. Use this method to specify subsurface scattering parameters. |
ID3DXPRTEngine::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. |
ID3DXPRTEngine::SetPerTexelAlbedo | Sets an albedo value for each texel, overwriting previous albedo values. |
ID3DXPRTEngine::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). |
ID3DXPRTEngine::SetPerVertexAlbedo | Sets an albedo value for each mesh vertex, overwriting previous albedo values. |
ID3DXPRTEngine::SetSamplingInfo | Sets sampling properties used by the precomputed radiance transfer (PRT) simulator. |
ID3DXPRTEngine::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. |
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;
D3DXCreatePRTEngine, Precomputed Radiance Transfer
Header: Declared in D3dx9mesh.h.
Import Library: Use D3dx9.lib.