Table of Contents

Class ShapeBuilderRibbon

Namespace
Stride.Particles.ShapeBuilders
Assembly
Stride.Particles.dll

Shape builder which builds all particles as a ribbon, connecting adjacent particles with camera-facing quads

[DataContract("ShapeBuilderRibbon")]
[Display("Ribbon", null)]
public class ShapeBuilderRibbon : ShapeBuilder
Inheritance
ShapeBuilderRibbon
Inherited Members

Properties

QuadsPerParticle

Returns the number of quads required per particle to draw all particles. Assuming 1 Quad = 4 Vertices = 6 Indices

public override int QuadsPerParticle { get; protected set; }

Property Value

int

Segments

If the ribbon is smotthed, how many segments should be used between each two particles

[DataMember(6)]
[Display("Segments", null)]
public int Segments { get; set; }

Property Value

int

SmoothingPolicy

Smoothing provides the option to additionally smooth the ribbon, enhancing visual quality for sharp angles

[DataMember(5)]
[Display("Smoothing", null)]
public SmoothingPolicy SmoothingPolicy { get; set; }

Property Value

SmoothingPolicy

TexCoordsFactor

The factor (coefficient) for length to use when building texture coordinates

[DataMember(20)]
[Display("UV Factor", null)]
public float TexCoordsFactor { get; set; }

Property Value

float

TextureCoordinatePolicy

Specifies how texture coordinates for the ribbons should be built

[DataMember(10)]
[Display("UV Coords", null)]
public TextureCoordinatePolicy TextureCoordinatePolicy { get; set; }

Property Value

TextureCoordinatePolicy

UVRotate

Texture coordinates flip and rotate policy

[DataMember(30)]
[Display("UV Rotate", null)]
public UVRotate UVRotate { get; set; }

Property Value

UVRotate

Methods

BuildVertexBuffer(ref ParticleBufferState, Vector3, Vector3, ref Vector3, ref Quaternion, float, ref ParticleList, ref Matrix)

Builds the actual vertex buffer for the current frame using the particle data

public override int BuildVertexBuffer(ref ParticleBufferState bufferState, Vector3 invViewX, Vector3 invViewY, ref Vector3 spaceTranslation, ref Quaternion spaceRotation, float spaceScale, ref ParticleList sorter, ref Matrix viewProj)

Parameters

bufferState ParticleBufferState

Target particle buffer state, used to populate the assigned vertex buffer

invViewX Vector3

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

invViewY Vector3

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

spaceTranslation Vector3

Translation of the target draw space in regard to the particle data (world or local)

spaceRotation Quaternion

Rotation of the target draw space in regard to the particle data (world or local)

spaceScale float

Uniform scale of the target draw space in regard to the particle data (world or local)

sorter ParticleList

Particle enumerator which can be iterated and returns sported particles

viewProj Matrix

The View-Projection matrix which is used for some shape builders

Returns

int

SetRequiredQuads(int, int, int)

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

public override void SetRequiredQuads(int quadsPerParticle, int livingParticles, int totalParticles)

Parameters

quadsPerParticle int

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

livingParticles int

Number of living particles this frame

totalParticles int

Number of total number of possible particles for the parent emitter