Stride

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

  • Discord
  • Facebook
  • Twitter
  • YouTube

LANGUAGE

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

    ParticleVertexBuilder Class

    Namespace: Stride.Particles.VertexLayouts
    Assembly: Stride.Particles.dll

    Manager class for the vertex buffer stream which can dynamically change the required vertex layout and rebuild the buffer based on the particle fields

    System.Object → ParticleVertexBuilder
    Derived from ParticleVertexBuilder:

    public class ParticleVertexBuilder
    Name Description
    Constructors
    ParticleVertexBuilder()

    Default constructor

    Fields
    IndicesPerQuad
    Properties
    DefaultTexCoords

    The default texture coordinates will default to the first texture coordinates element added to the list in case there are two or more sets

    IsBufferDirty
    LivingQuads
    MaxParticles
    VertexCount

    The current number of vertices which have to be drawn

    VertexDeclaration

    The current VertexDeclaration of the contained vertex buffer

    VerticesPerParticle
    Methods
    AddVertexElement(VertexElement)

    Adds a new required element to the list of vertex elements, if it's not in the list already

    Reset()

    Resets the ParticleVertexBuilder to its initial state, freeing any graphics memory used

    ResetVertexElementList()

    Resets the list of required vertex elements, setting it to the minimum mandatory length

    SetDirty(Boolean)
    SetRequiredQuads(Int32, Int32, Int32)

    Sets the required quads per particle and number of particles so that a sufficiently big buffer can be allocated

    UpdateVertexLayout()

    Updates the vertex layout with the new list. Should be called only when there have been changes to the list.

    | Improve this Doc View Source

    Constructors


    ParticleVertexBuilder()

    Default constructor

    public ParticleVertexBuilder()
    | Improve this Doc View Source

    Fields


    IndicesPerQuad

    public readonly int IndicesPerQuad
    Field Value
    Type Description
    System.Int32
    | Improve this Doc View Source

    Properties


    DefaultTexCoords

    The default texture coordinates will default to the first texture coordinates element added to the list in case there are two or more sets

    public AttributeDescription DefaultTexCoords { get; }
    Property Value
    Type Description
    AttributeDescription

    IsBufferDirty

    public bool IsBufferDirty { get; }
    Property Value
    Type Description
    System.Boolean

    LivingQuads

    public int LivingQuads { get; }
    Property Value
    Type Description
    System.Int32

    MaxParticles

    public int MaxParticles { get; }
    Property Value
    Type Description
    System.Int32

    VertexCount

    The current number of vertices which have to be drawn

    public int VertexCount { get; }
    Property Value
    Type Description
    System.Int32

    VertexDeclaration

    The current VertexDeclaration of the contained vertex buffer

    public VertexDeclaration VertexDeclaration { get; }
    Property Value
    Type Description
    VertexDeclaration

    VerticesPerParticle

    public int VerticesPerParticle { get; }
    Property Value
    Type Description
    System.Int32
    | Improve this Doc View Source

    Methods


    AddVertexElement(VertexElement)

    Adds a new required element to the list of vertex elements, if it's not in the list already

    public void AddVertexElement(VertexElement element)
    Parameters
    Type Name Description
    VertexElement element

    New element to add


    Reset()

    Resets the ParticleVertexBuilder to its initial state, freeing any graphics memory used

    public void Reset()

    ResetVertexElementList()

    Resets the list of required vertex elements, setting it to the minimum mandatory length

    public void ResetVertexElementList()

    SetDirty(Boolean)

    public void SetDirty(bool dirty)
    Parameters
    Type Name Description
    System.Boolean dirty

    SetRequiredQuads(Int32, Int32, Int32)

    Sets the required quads per particle and number of particles so that a sufficiently big buffer can be allocated

    public void SetRequiredQuads(int quadsPerParticle, int livingParticles, int totalParticles)
    Parameters
    Type Name Description
    System.Int32 quadsPerParticle

    Required quads per particle, assuming 1 quad = 4 vertices = 6 indices

    System.Int32 livingParticles

    Number of living particles this frame

    System.Int32 totalParticles

    Number of total number of possible particles for the parent emitter


    UpdateVertexLayout()

    Updates the vertex layout with the new list. Should be called only when there have been changes to the list.

    public void UpdateVertexLayout()

    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