Class ParticleVertexBuilder
- 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
public class ParticleVertexBuilder
- Inheritance
-
ParticleVertexBuilder
Constructors
ParticleVertexBuilder()
Default constructor
public ParticleVertexBuilder()
Fields
IndicesPerQuad
public readonly int IndicesPerQuad
Field Value
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
IsBufferDirty
public bool IsBufferDirty { get; }
Property Value
LivingQuads
public int LivingQuads { get; }
Property Value
MaxParticles
public int MaxParticles { get; }
Property Value
VertexCount
The current number of vertices which have to be drawn
public int VertexCount { get; }
Property Value
VertexDeclaration
The current VertexDeclaration of the contained vertex buffer
public VertexDeclaration VertexDeclaration { get; }
Property Value
VerticesPerParticle
public int VerticesPerParticle { get; }
Property Value
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
element
VertexElementNew 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(bool)
public void SetDirty(bool dirty)
Parameters
dirty
bool
SetRequiredQuads(int, int, int)
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
quadsPerParticle
intRequired quads per particle, assuming 1 quad = 4 vertices = 6 indices
livingParticles
intNumber of living particles this frame
totalParticles
intNumber 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()