Table of Contents

Class PhongMaterial

Namespace
HelixToolkit.Avalonia.SharpDX
Assembly
HelixToolkit.Avalonia.SharpDX.dll

Implements a phong-material with its all properties Includes Diffuse, Normal, Displacement, Specular, etc. maps

[DataContract]
public class PhongMaterial : Material, INotifyPropertyChanged, IDataContextProvider, ILogical, IThemeVariantHost, IResourceHost, IResourceNode, IStyleHost, ISetLogicalParent, ISetInheritanceParent, ISupportInitialize, IStyleable, INamed, IInputElement, IDataTemplateHost, ISetterValue
Inheritance
AvaloniaObject
Animatable
StyledElement
Visual
Layoutable
Interactive
InputElement
Control
PhongMaterial
Implements
IDataContextProvider
ILogical
IThemeVariantHost
IResourceHost
IResourceNode
IStyleHost
ISetLogicalParent
ISetInheritanceParent
IStyleable
INamed
IInputElement
IDataTemplateHost
ISetterValue
Inherited Members
Control.FocusAdornerProperty
Control.TagProperty
Control.ContextMenuProperty
Control.ContextFlyoutProperty
Control.RequestBringIntoViewEvent
Control.ContextRequestedEvent
Control.LoadedEvent
Control.UnloadedEvent
Control.SizeChangedEvent
Control.GetTemplateFocusTarget()
Control.OnLoaded(RoutedEventArgs)
Control.OnUnloaded(RoutedEventArgs)
Control.OnSizeChanged(SizeChangedEventArgs)
Control.OnAttachedToVisualTreeCore(VisualTreeAttachmentEventArgs)
Control.OnDetachedFromVisualTreeCore(VisualTreeAttachmentEventArgs)
Control.OnGotFocus(GotFocusEventArgs)
Control.OnLostFocus(RoutedEventArgs)
Control.OnCreateAutomationPeer()
Control.OnPointerReleased(PointerReleasedEventArgs)
Control.OnKeyUp(KeyEventArgs)
Control.OnPropertyChanged(AvaloniaPropertyChangedEventArgs)
Control.FocusAdorner
Control.DataTemplates
Control.ContextMenu
Control.ContextFlyout
Control.IsLoaded
Control.Tag
Control.ContextRequested
Control.Loaded
Control.Unloaded
Control.SizeChanged
InputElement.FocusableProperty
InputElement.IsEnabledProperty
InputElement.IsEffectivelyEnabledProperty
InputElement.CursorProperty
InputElement.IsKeyboardFocusWithinProperty
InputElement.IsFocusedProperty
InputElement.IsHitTestVisibleProperty
InputElement.IsPointerOverProperty
InputElement.IsTabStopProperty
InputElement.GotFocusEvent
InputElement.LostFocusEvent
InputElement.KeyDownEvent
InputElement.KeyUpEvent
InputElement.TabIndexProperty
InputElement.TextInputEvent
InputElement.TextInputMethodClientRequestedEvent
InputElement.PointerEnteredEvent
InputElement.PointerExitedEvent
InputElement.PointerMovedEvent
InputElement.PointerPressedEvent
InputElement.PointerReleasedEvent
InputElement.PointerCaptureLostEvent
InputElement.PointerWheelChangedEvent
InputElement.TappedEvent
InputElement.HoldingEvent
InputElement.DoubleTappedEvent
InputElement.Focus(NavigationMethod, KeyModifiers)
InputElement.OnKeyDown(KeyEventArgs)
InputElement.OnTextInput(TextInputEventArgs)
InputElement.OnPointerEntered(PointerEventArgs)
InputElement.OnPointerExited(PointerEventArgs)
InputElement.OnPointerMoved(PointerEventArgs)
InputElement.OnPointerPressed(PointerPressedEventArgs)
InputElement.OnPointerCaptureLost(PointerCaptureLostEventArgs)
InputElement.OnPointerWheelChanged(PointerWheelEventArgs)
InputElement.UpdateIsEffectivelyEnabled()
InputElement.Focusable
InputElement.IsEnabled
InputElement.Cursor
InputElement.IsKeyboardFocusWithin
InputElement.IsFocused
InputElement.IsHitTestVisible
InputElement.IsPointerOver
InputElement.IsTabStop
InputElement.IsEffectivelyEnabled
InputElement.TabIndex
InputElement.KeyBindings
InputElement.IsEnabledCore
InputElement.GestureRecognizers
InputElement.GotFocus
InputElement.LostFocus
InputElement.KeyDown
InputElement.KeyUp
InputElement.TextInput
InputElement.TextInputMethodClientRequested
InputElement.PointerEntered
InputElement.PointerExited
InputElement.PointerMoved
InputElement.PointerPressed
InputElement.PointerReleased
InputElement.PointerCaptureLost
InputElement.PointerWheelChanged
InputElement.Tapped
InputElement.Holding
InputElement.DoubleTapped
Interactive.RaiseEvent(RoutedEventArgs)
Interactive.BuildEventRoute(RoutedEvent)
Layoutable.DesiredSizeProperty
Layoutable.WidthProperty
Layoutable.HeightProperty
Layoutable.MinWidthProperty
Layoutable.MaxWidthProperty
Layoutable.MinHeightProperty
Layoutable.MaxHeightProperty
Layoutable.MarginProperty
Layoutable.HorizontalAlignmentProperty
Layoutable.VerticalAlignmentProperty
Layoutable.UseLayoutRoundingProperty
Layoutable.UpdateLayout()
Layoutable.ApplyTemplate()
Layoutable.Measure(Size)
Layoutable.Arrange(Rect)
Layoutable.InvalidateMeasure()
Layoutable.InvalidateArrange()
Layoutable.AffectsMeasure<T>(params AvaloniaProperty[])
Layoutable.AffectsArrange<T>(params AvaloniaProperty[])
Layoutable.MeasureCore(Size)
Layoutable.MeasureOverride(Size)
Layoutable.ArrangeCore(Rect)
Layoutable.ArrangeOverride(Size)
Layoutable.OnMeasureInvalidated()
Layoutable.OnVisualParentChanged(Visual, Visual)
Layoutable.Width
Layoutable.Height
Layoutable.MinWidth
Layoutable.MaxWidth
Layoutable.MinHeight
Layoutable.MaxHeight
Layoutable.Margin
Layoutable.HorizontalAlignment
Layoutable.VerticalAlignment
Layoutable.DesiredSize
Layoutable.IsMeasureValid
Layoutable.IsArrangeValid
Layoutable.UseLayoutRounding
Layoutable.EffectiveViewportChanged
Layoutable.LayoutUpdated
Visual.BoundsProperty
Visual.ClipToBoundsProperty
Visual.ClipProperty
Visual.IsVisibleProperty
Visual.OpacityProperty
Visual.OpacityMaskProperty
Visual.EffectProperty
Visual.HasMirrorTransformProperty
Visual.RenderTransformProperty
Visual.RenderTransformOriginProperty
Visual.FlowDirectionProperty
Visual.VisualParentProperty
Visual.ZIndexProperty
Visual.GetFlowDirection(Visual)
Visual.SetFlowDirection(Visual, FlowDirection)
Visual.InvalidateVisual()
Visual.Render(DrawingContext)
Visual.AffectsRender<T>(params AvaloniaProperty[])
Visual.OnAttachedToVisualTree(VisualTreeAttachmentEventArgs)
Visual.OnDetachedFromVisualTree(VisualTreeAttachmentEventArgs)
Visual.InvalidateMirrorTransform()
Visual.Bounds
Visual.ClipToBounds
Visual.Clip
Visual.IsEffectivelyVisible
Visual.IsVisible
Visual.Opacity
Visual.OpacityMask
Visual.Effect
Visual.HasMirrorTransform
Visual.RenderTransform
Visual.RenderTransformOrigin
Visual.FlowDirection
Visual.ZIndex
Visual.VisualChildren
Visual.VisualRoot
Visual.BypassFlowDirectionPolicies
Visual.AttachedToVisualTree
Visual.DetachedFromVisualTree
StyledElement.DataContextProperty
StyledElement.ParentProperty
StyledElement.TemplatedParentProperty
StyledElement.ThemeProperty
StyledElement.BeginInit()
StyledElement.EndInit()
StyledElement.ApplyStyling()
StyledElement.InitializeIfNeeded()
StyledElement.OnAttachedToLogicalTree(LogicalTreeAttachmentEventArgs)
StyledElement.OnDetachedFromLogicalTree(LogicalTreeAttachmentEventArgs)
StyledElement.OnDataContextBeginUpdate()
StyledElement.OnDataContextEndUpdate()
StyledElement.OnInitialized()
StyledElement.Classes
StyledElement.DataContext
StyledElement.IsInitialized
StyledElement.Styles
StyledElement.StyleKey
StyledElement.Resources
StyledElement.TemplatedParent
StyledElement.Theme
StyledElement.LogicalChildren
StyledElement.PseudoClasses
StyledElement.StyleKeyOverride
StyledElement.Parent
StyledElement.ActualThemeVariant
StyledElement.AttachedToLogicalTree
StyledElement.DetachedFromLogicalTree
StyledElement.DataContextChanged
StyledElement.Initialized
StyledElement.ResourcesChanged
StyledElement.ActualThemeVariantChanged
Animatable.TransitionsProperty
Animatable.OnPropertyChangedCore(AvaloniaPropertyChangedEventArgs)
Animatable.Transitions
AvaloniaObject.CheckAccess()
AvaloniaObject.VerifyAccess()
AvaloniaObject.ClearValue(AvaloniaProperty)
AvaloniaObject.ClearValue<T>(AvaloniaProperty<T>)
AvaloniaObject.ClearValue<T>(StyledProperty<T>)
AvaloniaObject.ClearValue<T>(DirectPropertyBase<T>)
AvaloniaObject.GetHashCode()
AvaloniaObject.GetValue(AvaloniaProperty)
AvaloniaObject.GetValue<T>(StyledProperty<T>)
AvaloniaObject.GetValue<T>(DirectPropertyBase<T>)
AvaloniaObject.GetBaseValue<T>(StyledProperty<T>)
AvaloniaObject.IsAnimating(AvaloniaProperty)
AvaloniaObject.IsSet(AvaloniaProperty)
AvaloniaObject.SetValue<T>(StyledProperty<T>, T, BindingPriority)
AvaloniaObject.SetValue<T>(DirectPropertyBase<T>, T)
AvaloniaObject.SetCurrentValue<T>(StyledProperty<T>, T)
AvaloniaObject.Bind(AvaloniaProperty, IBinding)
AvaloniaObject.CoerceValue(AvaloniaProperty)
AvaloniaObject.RaisePropertyChanged<T>(DirectPropertyBase<T>, T, T)
AvaloniaObject.SetAndRaise<T>(DirectPropertyBase<T>, ref T, T)
AvaloniaObject.InheritanceParent
AvaloniaObject.this[AvaloniaProperty]
AvaloniaObject.this[IndexerDescriptor]
AvaloniaObject.PropertyChanged
Extension Methods

Constructors

PhongMaterial()

Constructs a Shading Material which correspnds with the Phong and BlinnPhong lighting models.

public PhongMaterial()

PhongMaterial(PhongMaterialCore)

Initializes a new instance of the PhongMaterial class.

public PhongMaterial(PhongMaterialCore core)

Parameters

core PhongMaterialCore

The core.

Fields

AmbientColorProperty

Identifies the System.Windows.Media.Media3D.DiffuseMaterial.AmbientColor�dependency property.

public static readonly AvaloniaProperty AmbientColorProperty

Field Value

AvaloniaProperty

DiffuseAlphaMapProperty

Supports alpha channel image, such as PNG. Usage: Load the image file(BMP, PNG, etc) as a TextureModel. It can be used to replace DiffuseMap, or used as a mask and apply onto diffuse map. The color will be cDiffuse*cAlpha.

public static readonly AvaloniaProperty DiffuseAlphaMapProperty

Field Value

AvaloniaProperty

DiffuseColorProperty

Identifies the System.Windows.Media.Media3D.DiffuseMaterial.Color�dependency property.

public static readonly AvaloniaProperty DiffuseColorProperty

Field Value

AvaloniaProperty

DiffuseMapProperty

public static readonly AvaloniaProperty DiffuseMapProperty

Field Value

AvaloniaProperty

DiffuseMapSamplerProperty

public static readonly AvaloniaProperty DiffuseMapSamplerProperty

Field Value

AvaloniaProperty

DisplacementMapProperty

public static readonly AvaloniaProperty DisplacementMapProperty

Field Value

AvaloniaProperty

DisplacementMapSamplerProperty

public static readonly AvaloniaProperty DisplacementMapSamplerProperty

Field Value

AvaloniaProperty

DisplacementMapScaleMaskProperty

public static readonly AvaloniaProperty DisplacementMapScaleMaskProperty

Field Value

AvaloniaProperty

EmissiveColorProperty

public static readonly AvaloniaProperty EmissiveColorProperty

Field Value

AvaloniaProperty

EmissiveMapProperty

public static readonly AvaloniaProperty EmissiveMapProperty

Field Value

AvaloniaProperty

EnableAutoTangentProperty

The enable automatic tangent

public static readonly AvaloniaProperty EnableAutoTangentProperty

Field Value

AvaloniaProperty

EnableFlatShadingProperty

public static readonly AvaloniaProperty EnableFlatShadingProperty

Field Value

AvaloniaProperty

EnableTessellationProperty

The enable tessellation property

public static readonly AvaloniaProperty EnableTessellationProperty

Field Value

AvaloniaProperty

MaxDistanceTessellationFactorProperty

The tessellation factor at MaxTessellationDistance property

public static readonly AvaloniaProperty MaxDistanceTessellationFactorProperty

Field Value

AvaloniaProperty

MaxTessellationDistanceProperty

The maximum tessellation distance property

public static readonly AvaloniaProperty MaxTessellationDistanceProperty

Field Value

AvaloniaProperty

MinDistanceTessellationFactorProperty

The tessellation factor at MinTessellationDistance property

public static readonly AvaloniaProperty MinDistanceTessellationFactorProperty

Field Value

AvaloniaProperty

MinTessellationDistanceProperty

The minimum tessellation distance property

public static readonly AvaloniaProperty MinTessellationDistanceProperty

Field Value

AvaloniaProperty

NormalMapProperty

public static readonly AvaloniaProperty NormalMapProperty

Field Value

AvaloniaProperty

ReflectiveColorProperty

public static readonly AvaloniaProperty ReflectiveColorProperty

Field Value

AvaloniaProperty

RenderDiffuseAlphaMapProperty

public static readonly AvaloniaProperty RenderDiffuseAlphaMapProperty

Field Value

AvaloniaProperty

RenderDiffuseMapProperty

public static readonly AvaloniaProperty RenderDiffuseMapProperty

Field Value

AvaloniaProperty

RenderDisplacementMapProperty

public static readonly AvaloniaProperty RenderDisplacementMapProperty

Field Value

AvaloniaProperty

RenderEmissiveMapProperty

public static readonly AvaloniaProperty RenderEmissiveMapProperty

Field Value

AvaloniaProperty

RenderEnvironmentMapProperty

The render environment map property

public static readonly AvaloniaProperty RenderEnvironmentMapProperty

Field Value

AvaloniaProperty

RenderNormalMapProperty

public static readonly AvaloniaProperty RenderNormalMapProperty

Field Value

AvaloniaProperty

RenderShadowMapProperty

The render shadow map property

public static readonly AvaloniaProperty RenderShadowMapProperty

Field Value

AvaloniaProperty

RenderSpecularColorMapProperty

public static readonly AvaloniaProperty RenderSpecularColorMapProperty

Field Value

AvaloniaProperty

SpecularColorMapProperty

public static readonly AvaloniaProperty SpecularColorMapProperty

Field Value

AvaloniaProperty

SpecularColorProperty

public static readonly AvaloniaProperty SpecularColorProperty

Field Value

AvaloniaProperty

SpecularShininessProperty

public static readonly AvaloniaProperty SpecularShininessProperty

Field Value

AvaloniaProperty

UVTransformProperty

The uv transform property

public static readonly AvaloniaProperty UVTransformProperty

Field Value

AvaloniaProperty

VertexColorBlendingFactorProperty

public static readonly AvaloniaProperty VertexColorBlendingFactorProperty

Field Value

AvaloniaProperty

Properties

AmbientColor

Gets or sets a color that represents how the material reflects System.Windows.Media.Media3D.AmbientLight. For details see: http://msdn.microsoft.com/en-us/library/windows/desktop/bb147175(v=vs.85).aspx

[TypeConverter(typeof(Color4Converter))]
public Color4 AmbientColor { get; set; }

Property Value

Color4

DiffuseAlphaMap

public TextureModel? DiffuseAlphaMap { get; set; }

Property Value

TextureModel

DiffuseColor

Gets or sets the diffuse color for the material. For details see: http://msdn.microsoft.com/en-us/library/windows/desktop/bb147175(v=vs.85).aspx

[TypeConverter(typeof(Color4Converter))]
public Color4 DiffuseColor { get; set; }

Property Value

Color4

DiffuseMap

System.Windows.Media.Brush to be applied as a System.Windows.Media.Media3D.Material to a 3-D model.

public TextureModel? DiffuseMap { get; set; }

Property Value

TextureModel

DiffuseMapSampler

public SamplerStateDescription DiffuseMapSampler { get; set; }

Property Value

SamplerStateDescription

DisplacementMap

public TextureModel? DisplacementMap { get; set; }

Property Value

TextureModel

DisplacementMapSampler

public SamplerStateDescription DisplacementMapSampler { get; set; }

Property Value

SamplerStateDescription

DisplacementMapScaleMask

[TypeConverter(typeof(Vector4Converter))]
public Vector4 DisplacementMapScaleMask { get; set; }

Property Value

Vector4

EmissiveColor

Gets or sets the emissive color for the material. For details see: http://msdn.microsoft.com/en-us/library/windows/desktop/bb147175(v=vs.85).aspx

[TypeConverter(typeof(Color4Converter))]
public Color4 EmissiveColor { get; set; }

Property Value

Color4

EmissiveMap

public TextureModel? EmissiveMap { get; set; }

Property Value

TextureModel

EnableAutoTangent

Gets or sets a value indicating whether [enable automatic tangent].

public bool EnableAutoTangent { get; set; }

Property Value

bool

true if [enable automatic tangent]; otherwise, false.

EnableFlatShading

Gets or sets a value indicating whether [enable flat shading].

public bool EnableFlatShading { get; set; }

Property Value

bool

true if [enable flat shading]; otherwise, false.

EnableTessellation

Gets or sets a value indicating whether [enable tessellation].

public bool EnableTessellation { get; set; }

Property Value

bool

true if [enable tessellation]; otherwise, false.

MaxDistanceTessellationFactor

Gets or sets the tessellation factor at MaxTessellationDistance.

public double MaxDistanceTessellationFactor { get; set; }

Property Value

double

The maximum tessellation factor.

MaxTessellationDistance

Gets or sets the maximum tessellation distance.

public double MaxTessellationDistance { get; set; }

Property Value

double

The maximum tessellation distance.

MinDistanceTessellationFactor

Gets or sets the tessellation factor at MinTessellationDistance

public double MinDistanceTessellationFactor { get; set; }

Property Value

double

The minimum tessellation factor.

MinTessellationDistance

Gets or sets the minimum tessellation distance.

public double MinTessellationDistance { get; set; }

Property Value

double

The minimum tessellation distance.

NormalMap

public TextureModel? NormalMap { get; set; }

Property Value

TextureModel

ReflectiveColor

A fake parameter for reflectivity of the environment map

[TypeConverter(typeof(Color4Converter))]
public Color4 ReflectiveColor { get; set; }

Property Value

Color4

RenderDiffuseAlphaMap

public bool RenderDiffuseAlphaMap { get; set; }

Property Value

bool

RenderDiffuseMap

public bool RenderDiffuseMap { get; set; }

Property Value

bool

RenderDisplacementMap

public bool RenderDisplacementMap { get; set; }

Property Value

bool

RenderEmissiveMap

public bool RenderEmissiveMap { get; set; }

Property Value

bool

RenderEnvironmentMap

Gets or sets a value indicating whether [render environment map]. Default is false

public bool RenderEnvironmentMap { get; set; }

Property Value

bool

true if [render environment map]; otherwise, false.

RenderNormalMap

public bool RenderNormalMap { get; set; }

Property Value

bool

RenderShadowMap

Gets or sets a value indicating whether [render shadow map]. Default is false

public bool RenderShadowMap { get; set; }

Property Value

bool

true if [render shadow map]; otherwise, false.

RenderSpecularColorMap

public bool RenderSpecularColorMap { get; set; }

Property Value

bool

SpecularColor

Gets or sets the specular color for the material. For details see: http://msdn.microsoft.com/en-us/library/windows/desktop/bb147175(v=vs.85).aspx

[TypeConverter(typeof(Color4Converter))]
public Color4 SpecularColor { get; set; }

Property Value

Color4

SpecularColorMap

public TextureModel? SpecularColorMap { get; set; }

Property Value

TextureModel

SpecularShininess

The power of specular reflections. For details see: http://msdn.microsoft.com/en-us/library/windows/desktop/bb147175(v=vs.85).aspx

public float SpecularShininess { get; set; }

Property Value

float

UVTransform

Gets or sets the texture uv transform.

public UVTransform UVTransform { get; set; }

Property Value

UVTransform

The uv transform.

VertexColorBlendingFactor

Gets or sets the vertex color blending factor. Final Diffuse Color = (1 - VertexColorBlendingFactor) * Diffuse + VertexColorBlendingFactor * Vertex Color

public double VertexColorBlendingFactor { get; set; }

Property Value

double

The vertex color blending factor.

Methods

CloneMaterial()

public virtual PhongMaterial CloneMaterial()

Returns

PhongMaterial

OnCreateCore()

protected override MaterialCore OnCreateCore()

Returns

MaterialCore

Operators

implicit operator PhongMaterial?(PhongMaterialCore?)

public static implicit operator PhongMaterial?(PhongMaterialCore? core)

Parameters

core PhongMaterialCore

Returns

PhongMaterial