ID3DXPRTEngine::SetMeshMaterials
Sets mesh material properties in the 3D scene. Use this method to specify subsurface scattering parameters.
HRESULT SetMeshMaterials(
CONST D3DXSHMATERIAL ** ppMaterials,
UINT NumMeshes,
UINT NumChannels,
BOOL bSetAlbedo,
FLOAT fLengthScale
);
Parameters
- ppMaterials
- [in] Address of a pointer to desired mesh material properties. See D3DXSHMATERIAL.
- NumMeshes
- [in] Index of the mesh on which to set material properties.
- NumChannels
- [in] Number of color channels to set in the mesh. Set to 1 to specify gray materials (R = G = B), or 3 to enable color bleeding effects. If you intend to change this parameter, first set the albedo using another method such as ID3DXPRTEngine::SetPerTexelAlbedo or ID3DXPRTEngine::SetPerVertexAlbedo.
- bSetAlbedo
- [in] If TRUE, sets the albedo of the mesh to ppMaterials, overwriting all existing texel and vertex albedo values. If FALSE, preserves all existing texel and vertex albedo values set by other methods; NumChannels must match the NumChannels parameter used to create the buffer in D3DXCreatePRTBuffer or D3DXCreatePRTBufferTex.
- fLengthScale
- [in] Scale of the 3D scene relative to a 1-mm cube. Used for subsurface scattering computations.
Return Values
If the method succeeds, the return value is S_OK. If the method fails, the return value can be one of the following: D3DERR_INVALIDCALL, E_OUTOFMEMORY.
Requirements
Header: Declared in D3dx9mesh.h.