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
-
AvaloniaObjectAnimatableStyledElementVisualLayoutableInteractiveInputElementControlPhongMaterial
- Implements
-
IDataContextProviderILogicalIThemeVariantHostIResourceHostIResourceNodeIStyleHostISetLogicalParentISetInheritanceParentIStyleableINamedIInputElementIDataTemplateHostISetterValue
- Inherited Members
-
Control.FocusAdornerPropertyControl.TagPropertyControl.ContextMenuPropertyControl.ContextFlyoutPropertyControl.RequestBringIntoViewEventControl.ContextRequestedEventControl.LoadedEventControl.UnloadedEventControl.SizeChangedEventControl.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.FocusAdornerControl.DataTemplatesControl.ContextMenuControl.ContextFlyoutControl.IsLoadedControl.TagControl.ContextRequestedControl.LoadedControl.UnloadedControl.SizeChangedInputElement.FocusablePropertyInputElement.IsEnabledPropertyInputElement.IsEffectivelyEnabledPropertyInputElement.CursorPropertyInputElement.IsKeyboardFocusWithinPropertyInputElement.IsFocusedPropertyInputElement.IsHitTestVisiblePropertyInputElement.IsPointerOverPropertyInputElement.IsTabStopPropertyInputElement.GotFocusEventInputElement.LostFocusEventInputElement.KeyDownEventInputElement.KeyUpEventInputElement.TabIndexPropertyInputElement.TextInputEventInputElement.TextInputMethodClientRequestedEventInputElement.PointerEnteredEventInputElement.PointerExitedEventInputElement.PointerMovedEventInputElement.PointerPressedEventInputElement.PointerReleasedEventInputElement.PointerCaptureLostEventInputElement.PointerWheelChangedEventInputElement.TappedEventInputElement.HoldingEventInputElement.DoubleTappedEventInputElement.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.FocusableInputElement.IsEnabledInputElement.CursorInputElement.IsKeyboardFocusWithinInputElement.IsFocusedInputElement.IsHitTestVisibleInputElement.IsPointerOverInputElement.IsTabStopInputElement.IsEffectivelyEnabledInputElement.TabIndexInputElement.KeyBindingsInputElement.IsEnabledCoreInputElement.GestureRecognizersInputElement.GotFocusInputElement.LostFocusInputElement.KeyDownInputElement.KeyUpInputElement.TextInputInputElement.TextInputMethodClientRequestedInputElement.PointerEnteredInputElement.PointerExitedInputElement.PointerMovedInputElement.PointerPressedInputElement.PointerReleasedInputElement.PointerCaptureLostInputElement.PointerWheelChangedInputElement.TappedInputElement.HoldingInputElement.DoubleTappedInteractive.RaiseEvent(RoutedEventArgs)Interactive.BuildEventRoute(RoutedEvent)Layoutable.DesiredSizePropertyLayoutable.WidthPropertyLayoutable.HeightPropertyLayoutable.MinWidthPropertyLayoutable.MaxWidthPropertyLayoutable.MinHeightPropertyLayoutable.MaxHeightPropertyLayoutable.MarginPropertyLayoutable.HorizontalAlignmentPropertyLayoutable.VerticalAlignmentPropertyLayoutable.UseLayoutRoundingPropertyLayoutable.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.WidthLayoutable.HeightLayoutable.MinWidthLayoutable.MaxWidthLayoutable.MinHeightLayoutable.MaxHeightLayoutable.MarginLayoutable.HorizontalAlignmentLayoutable.VerticalAlignmentLayoutable.DesiredSizeLayoutable.IsMeasureValidLayoutable.IsArrangeValidLayoutable.UseLayoutRoundingLayoutable.EffectiveViewportChangedLayoutable.LayoutUpdatedVisual.BoundsPropertyVisual.ClipToBoundsPropertyVisual.ClipPropertyVisual.IsVisiblePropertyVisual.OpacityPropertyVisual.OpacityMaskPropertyVisual.EffectPropertyVisual.HasMirrorTransformPropertyVisual.RenderTransformPropertyVisual.RenderTransformOriginPropertyVisual.FlowDirectionPropertyVisual.VisualParentPropertyVisual.ZIndexPropertyVisual.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.BoundsVisual.ClipToBoundsVisual.ClipVisual.IsEffectivelyVisibleVisual.IsVisibleVisual.OpacityVisual.OpacityMaskVisual.EffectVisual.HasMirrorTransformVisual.RenderTransformVisual.RenderTransformOriginVisual.FlowDirectionVisual.ZIndexVisual.VisualChildrenVisual.VisualRootVisual.BypassFlowDirectionPoliciesVisual.AttachedToVisualTreeVisual.DetachedFromVisualTreeStyledElement.DataContextPropertyStyledElement.ParentPropertyStyledElement.TemplatedParentPropertyStyledElement.ThemePropertyStyledElement.BeginInit()StyledElement.EndInit()StyledElement.ApplyStyling()StyledElement.InitializeIfNeeded()StyledElement.OnAttachedToLogicalTree(LogicalTreeAttachmentEventArgs)StyledElement.OnDetachedFromLogicalTree(LogicalTreeAttachmentEventArgs)StyledElement.OnDataContextBeginUpdate()StyledElement.OnDataContextEndUpdate()StyledElement.OnInitialized()StyledElement.ClassesStyledElement.DataContextStyledElement.IsInitializedStyledElement.StylesStyledElement.StyleKeyStyledElement.ResourcesStyledElement.TemplatedParentStyledElement.ThemeStyledElement.LogicalChildrenStyledElement.PseudoClassesStyledElement.StyleKeyOverrideStyledElement.ParentStyledElement.ActualThemeVariantStyledElement.AttachedToLogicalTreeStyledElement.DetachedFromLogicalTreeStyledElement.DataContextChangedStyledElement.InitializedStyledElement.ResourcesChangedStyledElement.ActualThemeVariantChangedAnimatable.TransitionsPropertyAnimatable.OnPropertyChangedCore(AvaloniaPropertyChangedEventArgs)Animatable.TransitionsAvaloniaObject.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.InheritanceParentAvaloniaObject.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
corePhongMaterialCoreThe 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
DiffuseAlphaMap
public TextureModel? DiffuseAlphaMap { get; set; }
Property Value
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
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
DiffuseMapSampler
public SamplerStateDescription DiffuseMapSampler { get; set; }
Property Value
- SamplerStateDescription
DisplacementMap
public TextureModel? DisplacementMap { get; set; }
Property Value
DisplacementMapSampler
public SamplerStateDescription DisplacementMapSampler { get; set; }
Property Value
- SamplerStateDescription
DisplacementMapScaleMask
[TypeConverter(typeof(Vector4Converter))]
public Vector4 DisplacementMapScaleMask { get; set; }
Property Value
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
EmissiveMap
public TextureModel? EmissiveMap { get; set; }
Property Value
EnableAutoTangent
Gets or sets a value indicating whether [enable automatic tangent].
public bool EnableAutoTangent { get; set; }
Property Value
- bool
trueif [enable automatic tangent]; otherwise,false.
EnableFlatShading
Gets or sets a value indicating whether [enable flat shading].
public bool EnableFlatShading { get; set; }
Property Value
- bool
trueif [enable flat shading]; otherwise,false.
EnableTessellation
Gets or sets a value indicating whether [enable tessellation].
public bool EnableTessellation { get; set; }
Property Value
- bool
trueif [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
ReflectiveColor
A fake parameter for reflectivity of the environment map
[TypeConverter(typeof(Color4Converter))]
public Color4 ReflectiveColor { get; set; }
Property Value
RenderDiffuseAlphaMap
public bool RenderDiffuseAlphaMap { get; set; }
Property Value
RenderDiffuseMap
public bool RenderDiffuseMap { get; set; }
Property Value
RenderDisplacementMap
public bool RenderDisplacementMap { get; set; }
Property Value
RenderEmissiveMap
public bool RenderEmissiveMap { get; set; }
Property Value
RenderEnvironmentMap
Gets or sets a value indicating whether [render environment map]. Default is false
public bool RenderEnvironmentMap { get; set; }
Property Value
- bool
trueif [render environment map]; otherwise,false.
RenderNormalMap
public bool RenderNormalMap { get; set; }
Property Value
RenderShadowMap
Gets or sets a value indicating whether [render shadow map]. Default is false
public bool RenderShadowMap { get; set; }
Property Value
- bool
trueif [render shadow map]; otherwise,false.
RenderSpecularColorMap
public bool RenderSpecularColorMap { get; set; }
Property Value
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
SpecularColorMap
public TextureModel? SpecularColorMap { get; set; }
Property Value
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
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
OnCreateCore()
protected override MaterialCore OnCreateCore()
Returns
Operators
implicit operator PhongMaterial?(PhongMaterialCore?)
public static implicit operator PhongMaterial?(PhongMaterialCore? core)
Parameters
corePhongMaterialCore