ID3DXPRTEngine::SetMeshMaterials method

Sets mesh material properties in the 3D scene. Use this method to specify subsurface scattering parameters.

Syntax

HRESULT SetMeshMaterials(
  [in] const D3DXSHMATERIAL **ppMaterials,
  [in]       UINT           NumMeshes,
  [in]       UINT           NumChannels,
  [in]       BOOL           bSetAlbedo,
  [in]       FLOAT          fLengthScale
);

Parameters

ppMaterials [in]

Type: const D3DXSHMATERIAL**

Address of a pointer to desired mesh material properties. See D3DXSHMATERIAL.

NumMeshes [in]

Type: UINT

Index of the mesh on which to set material properties.

NumChannels [in]

Type: UINT

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]

Type: BOOL

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]

Type: FLOAT

Scale of the 3D scene relative to a 1-mm cube. Used for subsurface scattering computations.

Return value

Type: HRESULT

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

Requirement Value
Header
D3DX9Mesh.h
Library
D3dx9.lib

See also

ID3DXPRTEngine