Click or drag to resize
AB4D logo

LineMaterial Class

LineMaterial defines properties that define how 3D lines are drawn.
Inheritance Hierarchy
SystemObject
  Ab3d.DirectXDXResourceBase
    Ab3d.DirectXSharedDXResource
      Ab3d.DirectXSharedDXDeviceResource
        Ab3d.DirectXMaterial
          Ab3d.DirectX.MaterialsLineMaterial
            Ab3d.DirectX.MaterialsPositionColoredLineMaterial

Namespace: Ab3d.DirectX.Materials
Assembly: Ab3d.DXEngine (in Ab3d.DXEngine.dll) Version: 7.0.8865.1045
Syntax
C#
public class LineMaterial : Material, 
	ILineMaterial, IZBufferStateMaterial, IPolyLine, ILinePattern, ILineRenderingTechnique

The LineMaterial type exposes the following members.

Constructors
 NameDescription
Public methodLineMaterial Constructor
Public methodLineMaterial(Color4, Single) Constructor
Top
Properties
 NameDescription
Public propertyDepthBias Gets a float that specifies a bias that is used when doing a depth test. A bias is a value that specifies how much the line is moved closer to the camera. The value is specified in world coordinates. When camera is farther away from the object, then a bigger DepthBias is needed.
Public propertyDynamicDepthBiasFactor When DynamicDepthBiasFactor is bigger then 0 then this factor is multiplied by the distance of the position to the camera and this is then multiplied by the DepthBias. This can be used to correctly set the depth bias for objects that are close (require small depth bias) to the camera and to the objects that are far away from the camera (require big depth bias). A recommended value is 0.02. This works well for all distances of 3D objects when the DepthBias is set to 0.1. For backwards compatibility the default value is 0.
Public propertyIsPolyLine Gets or sets a Boolean that specifies if the line segments are rendered as polyline with connected segments (when true), or disconnected segments (when false). Default value is false.
Public propertyStatic memberLineArrowAngle Gets or sets the angle of the line arrows. Default value is 15 degrees. Note that if the line is short so that the arrow length exceeds the amount defined by MaxLineArrowLength, the arrow is shortened which increased the arrow angle.
Public propertyLineColor Gets or sets the color of the line that is determined from the WpfModel material.
Public propertyLinePattern Gets or sets the 16 bit int value that defines the line pattern - if bit is 1 then line is drawn, when 0 line is not drawn. For example value 0xFFFF means full line without any dots or dashes. Value 0x5555 means line with dots - one full dot follows one empty dot. Default value is 0xFFFF which means that no pattern will be drawn.
Public propertyLinePatternOffset Gets or sets a pattern offset. This value is usually between 0 and 1 - 0 value means no offset, 1 means offset for the whole patter which is the same as no offset. Value 0.1 means that the line will begin with the pattern advanced by 10%. Default value is 0.
Public propertyLinePatternScale Gets or sets the pattern scale factor. Value 1 does not scale the pattern. Values bigger then 1 increase the pattern length; values smaller then 1 decrease the pattern length (making it more dense). Default value is 1.
Public propertyLineThickness Gets or sets the thickness of the line in screen space units. This value is scaled with DPI scale factor.
Public propertyStatic memberMaxLineArrowLength Gets or sets a float value that specifies the maximum arrow length set as fraction of the line length - e.g. 0.333 means that the maximum arrow length will be 1 / 3 (=0.333) of the line length. If the line is short so that the arrow length exceeds the amount defined by MaxLineArrowLength, the arrow is shortened (the arrow angle is increased).
Public propertyMiterLimit Gets or sets a float value that defines at which line thickness the mitered (sharp) line joint is converted into beveled (square) line joint. For example, a value of 4 requires the mitered joint length to be 4 times the line thickness before the joint becomes beveled. MiterLimit is used only when IsPolyLine is set to true. Default value is 2.
Public propertyReadZBuffer Gets or sets a Boolean that specifies if Z buffer is read when rendering the line - if the depth test is done when rendering the line. If false then the line is rendered regardless of its depth - if is rendered even if it is behind some other 3D objects.
Public propertyRenderAntialiased3DLines When RenderAntialiased3DLines is not null, then this overrides the RenderAntialiased3DLines setting in DXScene object. This setting can be used only when UseGeometryShaderFor3DLines is set to false.
Public propertyUseGeometryShaderFor3DLines When UseGeometryShaderFor3DLines is not null, then this overrides the UseGeometryShaderFor3DLines setting in DXScene object. If set to false and also the RenderAntialiased3DLines is set to false, then the lines are always rendered as 1 pixel thick lines. Note that when using super-sampling the line rendered with that DXAttribute become dimmer because the super-sampled image is still rendered with 1 pixel thick line and that is then down-sampled to final image.
Public propertyWriteZBuffer Gets or sets a Boolean that specifies if Z buffer is written when rendering the line - if the line can occlude other 3D objects. If true then the objects behind the line will not be rendered. If false the line will not prevent rendering objects behind it.
Top
Methods
 NameDescription
Public methodGetDefaultRenderingQueue Returns the RenderingQueue that should be used to render this material.
(Overrides MaterialGetDefaultRenderingQueue(DXScene))
Public methodToString ToString
(Overrides MaterialToString)
Top
Fields
 NameDescription
Public fieldStatic memberDefaultMiterLimit Miter limit value that is used when the MiterLimit is explicitly not specified.
Top
See Also