PrtEngine.SetMeshMaterials(SphericalHarmonicMaterial[],Int32,Boolean,Single) Method (Microsoft.DirectX.Direct3D)

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

Definition

Visual Basic Public Sub SetMeshMaterials( _
    ByVal materials() As SphericalHarmonicMaterial, _
    ByVal numberChannels As Integer, _
    ByVal setAlbedo As Boolean, _
    ByVal lengthScale As Single _
)
C# public void SetMeshMaterials(
    SphericalHarmonicMaterial[] materials,
    int numberChannels,
    bool setAlbedo,
    float lengthScale
);
C++ public:
void SetMeshMaterials(
    array<SphericalHarmonicMaterial>^ materials,
    int numberChannels,
    bool setAlbedo,
    float lengthScale
);
JScript public function SetMeshMaterials(
    materials : SphericalHarmonicMaterial[],
    numberChannels : int,
    setAlbedo : boolean,
    lengthScale : float
);

Parameters

materials Microsoft.DirectX.Direct3D.SphericalHarmonicMaterial[]
An array of SphericalHarmonicMaterial structures that contain the mesh material properties to set.
numberChannels System.Int32
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 PrtEngine.SetPerTexelAlbedo or PrtEngine.SetPerVertexAlbedo.
setAlbedo System.Boolean
Set to true to set the albedo of the mesh to materials, overwriting all existing texel and vertex albedo values. Set to false to preserve all existing texel and vertex albedo values set by other methods; numberChannels must match the numberChannels parameter of the PrtBuffer constructor used to create the buffer.
lengthScale System.Single
Scale of the 3-D scene relative to a 1 mm cube. Used for subsurface scattering computations.

Remarks

Exceptions

InvalidCallException

The method call is invalid. For example, a method's parameter might contain an invalid value.

OutOfMemoryExceptionLeave Site

Microsoft Direct3D could not allocate sufficient memory to complete the call.