Stride

OPEN / CLOSE
  • Features
  • Blog
  • Documentation
  • Community
(icon) Download

  • Discord
  • Facebook
  • Twitter
  • YouTube

LANGUAGE

OPEN / CLOSE
  • English
  • 日本語
    Show / Hide Table of Contents

    ParticleMaterialSimple Class

    Namespace: Stride.Particles.Materials
    Assembly: Stride.Particles.dll

    Simple base for most of the particle material classes which uses additive-alpha blending, face culling and setups the color vertex stream

    System.Object → ParticleMaterial → ParticleMaterialSimple
    Derived from ParticleMaterialSimple: ParticleMaterialComputeColor

    [DataContract("ParticleMaterialSimple")]
    public abstract class ParticleMaterialSimple : ParticleMaterial
    Name Description
    Properties
    AlphaAdditive

    Shows if the particles should be rendered as alhpa-blended, additive or something in-between (lerp between the two methods)

    FaceCulling

    Allows the particle shape to be back- or front-face culled.

    HasColorField

    Indicates if this material requires a color field in the vertex stream

    SoftEdgeDistance

    If positive, soft particle edges will be calculated with maximum distance of the value set.

    ZOffset

    Adjusts the depth of the particle in regard to opaque objects

    Methods
    ForceUpdate()

    Forces the material update, potentionally recreating the effect

    PatchVertexBuffer(ref ParticleBufferState, Vector3, Vector3, ref ParticleList)

    Patch the particle's vertex buffer which was already built by the ShapeBuilder This involes animating hte uv coordinates and filling per-particle fields, such as the color field

    PrepareVertexLayout(ParticlePoolFieldsList)

    Prepares the material for drawing the current frame with the current ParticleVertexBuilder and

    Setup(RenderContext)

    Setups the current material using the graphics device.

    SetupPipeline(RenderContext, PipelineStateDescription)
    ValidateEffect(RenderContext, ref EffectValidator)
    | Improve this Doc View Source

    Properties


    AlphaAdditive

    Shows if the particles should be rendered as alhpa-blended, additive or something in-between (lerp between the two methods)

    [DataMember(20)]
    [DataMemberRange(0, 1, 0.01, 0.1, 3)]
    [Display("Alpha-Add", null)]
    public float AlphaAdditive { get; set; }
    Property Value
    Type Description
    System.Single

    FaceCulling

    Allows the particle shape to be back- or front-face culled.

    [DataMember(40)]
    [Display("Culling", null)]
    public ParticleMaterialCulling FaceCulling { get; set; }
    Property Value
    Type Description
    ParticleMaterialCulling

    HasColorField

    Indicates if this material requires a color field in the vertex stream

    protected bool HasColorField { get; }
    Property Value
    Type Description
    System.Boolean

    SoftEdgeDistance

    If positive, soft particle edges will be calculated with maximum distance of the value set.

    [DataMember(35)]
    [Display("Soft Edge", null)]
    public float SoftEdgeDistance { get; set; }
    Property Value
    Type Description
    System.Single

    ZOffset

    Adjusts the depth of the particle in regard to opaque objects

    [DataMember(30)]
    [Display("Z Offset", null)]
    public float ZOffset { get; set; }
    Property Value
    Type Description
    System.Single
    | Improve this Doc View Source

    Methods


    ForceUpdate()

    Forces the material update, potentionally recreating the effect

    public override void ForceUpdate()
    Overrides
    ParticleMaterial.ForceUpdate()

    PatchVertexBuffer(ref ParticleBufferState, Vector3, Vector3, ref ParticleList)

    Patch the particle's vertex buffer which was already built by the ShapeBuilder This involes animating hte uv coordinates and filling per-particle fields, such as the color field

    public override void PatchVertexBuffer(ref ParticleBufferState bufferState, Vector3 invViewX, Vector3 invViewY, ref ParticleList sorter)
    Parameters
    Type Name Description
    ParticleBufferState bufferState

    The particle buffer state which is used to build the assigned vertex buffer

    Vector3 invViewX

    Unit vector X (right) in camera space, extracted from the inverse view matrix

    Vector3 invViewY

    Unit vector Y (up) in camera space, extracted from the inverse view matrix

    ParticleList sorter
    Overrides
    ParticleMaterial.PatchVertexBuffer(ref ParticleBufferState, Vector3, Vector3, ref ParticleList)

    PrepareVertexLayout(ParticlePoolFieldsList)

    Prepares the material for drawing the current frame with the current ParticleVertexBuilder and

    public override void PrepareVertexLayout(ParticlePoolFieldsList fieldsList)
    Parameters
    Type Name Description
    ParticlePoolFieldsList fieldsList

    A container for the ParticlePool which can poll if a certain field exists as an attribute

    Overrides
    ParticleMaterial.PrepareVertexLayout(ParticlePoolFieldsList)

    Setup(RenderContext)

    Setups the current material using the graphics device.

    public override void Setup(RenderContext context)
    Parameters
    Type Name Description
    RenderContext context
    Overrides
    ParticleMaterial.Setup(RenderContext)

    SetupPipeline(RenderContext, PipelineStateDescription)

    public override void SetupPipeline(RenderContext renderContext, PipelineStateDescription pipelineState)
    Parameters
    Type Name Description
    RenderContext renderContext
    PipelineStateDescription pipelineState
    Overrides
    ParticleMaterial.SetupPipeline(RenderContext, PipelineStateDescription)

    ValidateEffect(RenderContext, ref EffectValidator)

    public override void ValidateEffect(RenderContext context, ref EffectValidator effectValidator)
    Parameters
    Type Name Description
    RenderContext context
    EffectValidator effectValidator
    Overrides
    ParticleMaterial.ValidateEffect(RenderContext, ref EffectValidator)

    Inherited Members

    ParticleMaterial.Parameters
    ParticleMaterial.IsInitialized
    ParticleMaterial.HasVertexLayoutChanged
    ParticleMaterial.EffectName
    ParticleMaterial.UpdateVertexBuilder(ParticleVertexBuilder)
    ParticleMaterial.InitializeCore(RenderContext)

    Extension Methods

    ComponentBaseExtensions.DisposeBy<T>(T, ICollectorHolder)
    ComponentBaseExtensions.RemoveDisposeBy<T>(T, ICollectorHolder)
    • Improve this Doc
    • View Source
    In This Article

    Back to top

    Copyright © 2019-2021 .NET Foundation and Contributors
    Supported by the .NET Foundation