MaterialGroup Class
Represents a Material that is a composite of the Materials in its collection.
Assembly: PresentationCore (in PresentationCore.dll)
XMLNS for XAML: http://schemas.microsoft.com/winfx/2006/xaml/presentation, http://schemas.microsoft.com/netfx/2007/xaml/presentation
Because DiffuseMaterial, SpecularMaterial, and EmissiveMaterial provide distinctly different effects, it's useful to combine them. For example, you might choose to apply a complex texture to a mesh using DiffuseMaterial, while adding a highlighting effect with a SpecularMaterial on the same mesh. MaterialGroup allows you to treat these Materials as a single texture for convenience.
The following excerpt shows a MaterialGroup.
<MaterialGroup x:Key="LeavesMaterial1"> <DiffuseMaterial> <DiffuseMaterial.Brush> <ImageBrush Stretch="UniformToFill" ImageSource="sample_images\leaves_closeup.png" TileMode="None" ViewportUnits="Absolute" Viewport="0 0 1 1" AlignmentX="Left" AlignmentY="Top" Opacity="1.000000" /> </DiffuseMaterial.Brush> </DiffuseMaterial> <SpecularMaterial SpecularPower="85.3333"> <SpecularMaterial.Brush> <SolidColorBrush Color="#FFFFFF" Opacity="1.000000"/> </SpecularMaterial.Brush> </SpecularMaterial> </MaterialGroup>
More Code
| How to: Apply Emissive Material to a 3-D Object | The following example shows how to use EmissiveMaterial to add color to an existing Material equal to the color of the EmissiveMaterial's brush. The code below shows DiffuseMaterial and EmissiveMaterial applied in combination to add blue to the DiffuseMaterial's appearance. |
System.Windows.Threading.DispatcherObject
System.Windows.DependencyObject
System.Windows.Freezable
System.Windows.Media.Animation.Animatable
System.Windows.Media.Media3D.Material
System.Windows.Media.Media3D.MaterialGroup
Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.