Table of Contents

Class ParticleMaterialComputeColor

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

ParticleMaterialComputeColor uses a IComputeColor tree to calculate the pixel's emissive value

[DataContract("ParticleMaterialComputeColor")]
[Display("Emissive Map", null)]
public class ParticleMaterialComputeColor : ParticleMaterialSimple
Inheritance
ParticleMaterialComputeColor
Inherited Members

Properties

ComputeColor

IComputeColor allows several channels to be blended together, including textures, vertex streams and fixed values. Emissive Map should be allowed to be None because some particles might not need to render, but be used as parents for other particle systems

[DataMember(100)]
[Display("Emissive Map", null)]
public IComputeColor ComputeColor { get; set; }

Property Value

IComputeColor

EffectName

Sets the name of the effect or shader which the material will use

public override string EffectName { get; protected set; }

Property Value

string

ForceTexCoords

Forces the creation of texture coordinates as vertex attribute

[DataMember(300)]
[Display("Force texcoords", null)]
public bool ForceTexCoords { get; set; }

Property Value

bool

UVBuilder

UVBuilder defines how the base coordinates of the particle shape should be modified for texture scrolling, animation, etc.

[DataMember(200)]
[Display("UV coords", null)]
public UVBuilder UVBuilder { get; set; }

Property Value

UVBuilder

Methods

InitializeCore(RenderContext)

Initializes the core of the material, such as the shader generator and the parameter collection

protected override void InitializeCore(RenderContext context)

Parameters

context RenderContext

The current RenderContext

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

bufferState ParticleBufferState

The particle buffer state which is used to build 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

sorter ParticleList

Particle enumerator which can be iterated and returns sported particles

Setup(RenderContext)

Setups the current material using the graphics device.

public override void Setup(RenderContext context)

Parameters

context RenderContext

UpdateVertexBuilder(ParticleVertexBuilder)

Updates the required fields for this frame in the vertex buffer builder. If nothing has changed since the last frame and the vertex layout is the same, do not add any new required fields

public override void UpdateVertexBuilder(ParticleVertexBuilder vertexBuilder)

Parameters

vertexBuilder ParticleVertexBuilder

The target vertex buffer builder

ValidateEffect(RenderContext, ref EffectValidator)

public override void ValidateEffect(RenderContext context, ref EffectValidator effectValidator)

Parameters

context RenderContext
effectValidator EffectValidator