ParticleVertexBuilder Class
Namespace: Stride.Particles.VertexLayoutsAssembly: 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
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. |
Constructors
ParticleVertexBuilder()
Default constructor
public ParticleVertexBuilder()
Fields
IndicesPerQuad
public readonly int IndicesPerQuad
Field Value
Type | Description |
---|---|
System.Int32 |
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 |
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()