Class BatchedMeshNode
- Namespace
- HelixToolkit.SharpDX.Model.Scene
- Assembly
- HelixToolkit.SharpDX.dll
Static mesh batching. Supports multiple Materials. All geometries are merged into single buffer for rendering. Indivisual material color infomations are encoded into vertex buffer.
Material is used if Materials = null. And also used for shared material texture binding.
public class BatchedMeshNode : SceneNode, IDisposable, IComparable<SceneNode>, IAnimationNode, IHitable, IThrowingShadow, IBoundable, IApplyPostEffect
- Inheritance
-
BatchedMeshNode
- Implements
- Inherited Members
- Extension Methods
Constructors
BatchedMeshNode()
public BatchedMeshNode()
Fields
OnCreateRasterState
Create raster state description delegate.
If OnCreateRasterState is set, then CreateRasterState() will not be called.
public BatchedMeshNode.CreateRasterStateFunc? OnCreateRasterState
Field Value
batchingBuffer
protected DefaultStaticMeshBatchingBuffer? batchingBuffer
Field Value
Properties
BatchedGeometryOctree
protected StaticBatchedGeometryBoundsOctree? BatchedGeometryOctree { get; }
Property Value
Bounds
Gets the bounds. Usually same as OriginalBounds. If have instances, the bound will enclose all instances.
public override BoundingBox Bounds { get; }
Property Value
- BoundingBox
The bounds.
BoundsSphere
Gets the bounds sphere. Usually same as OriginalBoundsSphere. If have instances, the bound sphere will enclose all instances.
public override BoundingSphere BoundsSphere { get; }
Property Value
- BoundingSphere
The bounds sphere.
BoundsSphereWithTransform
Gets the bounds sphere with transform. If have transform, the bound is the transformed BoundsSphere
public override BoundingSphere BoundsSphereWithTransform { get; }
Property Value
- BoundingSphere
The bounds sphere with transform.
BoundsWithTransform
Gets the bounds with transform. Usually same as Bounds. If have transform, the bound is the transformed Bounds
public override BoundingBox BoundsWithTransform { get; }
Property Value
- BoundingBox
The bounds with transform.
CullMode
Gets or sets the cull mode.
public CullMode CullMode { get; set; }
Property Value
- CullMode
The cull mode.
DepthBias
Gets or sets the depth bias.
public int DepthBias { get; set; }
Property Value
- int
The depth bias.
EnableViewFrustumCheck
Gets or sets a value indicating whether [enable view frustum check].
public bool EnableViewFrustumCheck { get; set; }
Property Value
- bool
trueif [enable view frustum check]; otherwise,false.
FillMode
Gets or sets the fill mode.
public FillMode FillMode { get; set; }
Property Value
- FillMode
The fill mode.
FrontCCW
Gets or sets a value indicating whether [front CCW].
public bool FrontCCW { get; set; }
Property Value
- bool
trueif [front CCW]; otherwise,false.
Geometries
public BatchedMeshGeometryConfig[]? Geometries { get; set; }
Property Value
InvertNormal
Gets or sets a value indicating whether [invert normal].
public bool InvertNormal { get; set; }
Property Value
- bool
trueif [invert normal]; otherwise,false.
IsDepthClipEnabled
Gets or sets a value indicating whether this instance is depth clip enabled.
public bool IsDepthClipEnabled { get; set; }
Property Value
- bool
trueif this instance is depth clip enabled; otherwise,false.
IsMSAAEnabled
Gets or sets a value indicating whether Multisampling Anti-Aliasing enabled.
public bool IsMSAAEnabled { get; set; }
Property Value
- bool
trueif this instance is msaa enabled; otherwise,false.
IsScissorEnabled
Gets or sets a value indicating whether this instance is scissor enabled.
public bool IsScissorEnabled { get; set; }
Property Value
- bool
trueif this instance is scissor enabled; otherwise,false.
IsThrowingShadow
Gets or sets a value indicating whether this instance is throwing shadow.
public bool IsThrowingShadow { get; set; }
Property Value
- bool
trueif this instance is throwing shadow; otherwise,false.
IsTransparent
Specifiy if model material is transparent. During rendering, transparent objects are rendered after opaque objects. Transparent objects' order in scene graph are preserved.
public bool IsTransparent { get; set; }
Property Value
Material
public MaterialCore? Material { get; set; }
Property Value
Materials
public PhongMaterialCore[]? Materials { get; set; }
Property Value
OriginalBounds
Gets the original bound from the geometry. Same as Bound
public override BoundingBox OriginalBounds { get; }
Property Value
- BoundingBox
The original bound.
OriginalBoundsSphere
Gets the original bound sphere from the geometry. Same as BoundingSphere
public override BoundingSphere OriginalBoundsSphere { get; }
Property Value
- BoundingSphere
The original bound sphere.
PostEffects
Gets or sets the post effects.
public string PostEffects { get; set; }
Property Value
- string
The post effects.
RenderWireframe
Gets or sets a value indicating whether [render wireframe].
public bool RenderWireframe { get; set; }
Property Value
- bool
trueif [render wireframe]; otherwise,false.
SlopeScaledDepthBias
Gets or sets the slope scaled depth bias.
public float SlopeScaledDepthBias { get; set; }
Property Value
- float
The slope scaled depth bias.
WireframeColor
Gets or sets the color of the wireframe.
public Color4 WireframeColor { get; set; }
Property Value
- Color4
The color of the wireframe.
Methods
AttachMaterial()
protected virtual void AttachMaterial()
CanHitTest(HitTestContext?)
Determines whether this instance [can hit test] the specified context.
protected override bool CanHitTest(HitTestContext? context)
Parameters
contextHitTestContextThe context.
Returns
- bool
trueif this instance [can hit test] the specified context; otherwise,false.
CanRender(RenderContext)
Determine if this can be rendered.
protected override bool CanRender(RenderContext context)
Parameters
contextRenderContext
Returns
CreateRasterState()
Create raster state description.
protected virtual RasterizerStateDescription CreateRasterState()
Returns
- RasterizerStateDescription
OnAttach(IEffectsManager)
To override Attach routine, please override this.
protected override bool OnAttach(IEffectsManager effectsManager)
Parameters
effectsManagerIEffectsManager
Returns
- bool
Return true if attached
OnAttached()
Called when [attached].
protected override void OnAttached()
OnCreateRenderCore()
Called when [create render core].
protected override RenderCore OnCreateRenderCore()
Returns
OnCreateRenderTechnique(IEffectsManager)
Override this function to set render technique during Attach Host.
If OnSetRenderTechnique is set, then OnSetRenderTechnique instead of OnCreateRenderTechnique(IEffectsManager) function will be called.
protected override IRenderTechnique? OnCreateRenderTechnique(IEffectsManager effectsManager)
Parameters
effectsManagerIEffectsManager
Returns
- IRenderTechnique
Return RenderTechnique
OnDetach()
Used to override Detach
protected override void OnDetach()
OnHitTest(HitTestContext?, Matrix4x4, ref List<HitTestResult>)
Called when [hit test].
protected override bool OnHitTest(HitTestContext? context, Matrix4x4 totalModelMatrix, ref List<HitTestResult> hits)
Parameters
contextHitTestContextThe context.
totalModelMatrixMatrix4x4The total model matrix.
hitsList<HitTestResult>The hits.
Returns
OnRasterStateChanged()
Called when [raster state changed].
protected virtual void OnRasterStateChanged()
OnUpdateRenderOrderKey()
protected override OrderKey OnUpdateRenderOrderKey()
Returns
TestViewFrustum(ref BoundingFrustum)
Views the frustum test.
public override bool TestViewFrustum(ref BoundingFrustum viewFrustum)
Parameters
viewFrustumBoundingFrustumThe view frustum.
Returns
UpdateNotRender(RenderContext)
Updates the not render.
public override void UpdateNotRender(RenderContext context)
Parameters
contextRenderContextThe context.