ParticleMaterialSimple Class
Namespace: Stride.Particles.MaterialsAssembly: Stride.Particles.dll
Simple base for most of the particle material classes which uses additive-alpha blending, face culling and setups the color vertex stream
[DataContract("ParticleMaterialSimple")]
public abstract class ParticleMaterialSimple : ParticleMaterial
Name | Description | |
---|---|---|
Properties | ||
AlphaAdditive | Shows if the particles should be rendered as alhpa-blended, additive or something in-between (lerp between the two methods) |
|
FaceCulling | Allows the particle shape to be back- or front-face culled. |
|
HasColorField | Indicates if this material requires a color field in the vertex stream |
|
SoftEdgeDistance | If positive, soft particle edges will be calculated with maximum distance of the value set. |
|
ZOffset | Adjusts the depth of the particle in regard to opaque objects |
|
Methods | ||
ForceUpdate() | Forces the material update, potentionally recreating the effect |
|
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 |
|
PrepareVertexLayout(ParticlePoolFieldsList) | Prepares the material for drawing the current frame with the current ParticleVertexBuilder and |
|
Setup(RenderContext) | Setups the current material using the graphics device. |
|
SetupPipeline(RenderContext, PipelineStateDescription) | ||
ValidateEffect(RenderContext, ref EffectValidator) |
Properties
AlphaAdditive
Shows if the particles should be rendered as alhpa-blended, additive or something in-between (lerp between the two methods)
[DataMember(20)]
[DataMemberRange(0, 1, 0.01, 0.1, 3)]
[Display("Alpha-Add", null)]
public float AlphaAdditive { get; set; }
Property Value
Type | Description |
---|---|
System.Single |
FaceCulling
Allows the particle shape to be back- or front-face culled.
[DataMember(40)]
[Display("Culling", null)]
public ParticleMaterialCulling FaceCulling { get; set; }
Property Value
Type | Description |
---|---|
ParticleMaterialCulling |
HasColorField
Indicates if this material requires a color field in the vertex stream
protected bool HasColorField { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
SoftEdgeDistance
If positive, soft particle edges will be calculated with maximum distance of the value set.
[DataMember(35)]
[Display("Soft Edge", null)]
public float SoftEdgeDistance { get; set; }
Property Value
Type | Description |
---|---|
System.Single |
ZOffset
Adjusts the depth of the particle in regard to opaque objects
[DataMember(30)]
[Display("Z Offset", null)]
public float ZOffset { get; set; }
Property Value
Type | Description |
---|---|
System.Single |
Methods
ForceUpdate()
Forces the material update, potentionally recreating the effect
public override void ForceUpdate()
Overrides
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
Type | Name | Description |
---|---|---|
ParticleBufferState | bufferState | The particle buffer state which is used to build the assigned vertex buffer |
Vector3 | invViewX | Unit vector X (right) in camera space, extracted from the inverse view matrix |
Vector3 | invViewY | Unit vector Y (up) in camera space, extracted from the inverse view matrix |
ParticleList | sorter |
Overrides
PrepareVertexLayout(ParticlePoolFieldsList)
Prepares the material for drawing the current frame with the current ParticleVertexBuilder and
public override void PrepareVertexLayout(ParticlePoolFieldsList fieldsList)
Parameters
Type | Name | Description |
---|---|---|
ParticlePoolFieldsList | fieldsList | A container for the ParticlePool which can poll if a certain field exists as an attribute |
Overrides
Setup(RenderContext)
Setups the current material using the graphics device.
public override void Setup(RenderContext context)
Parameters
Type | Name | Description |
---|---|---|
RenderContext | context |
Overrides
SetupPipeline(RenderContext, PipelineStateDescription)
public override void SetupPipeline(RenderContext renderContext, PipelineStateDescription pipelineState)
Parameters
Type | Name | Description |
---|---|---|
RenderContext | renderContext | |
PipelineStateDescription | pipelineState |
Overrides
ValidateEffect(RenderContext, ref EffectValidator)
public override void ValidateEffect(RenderContext context, ref EffectValidator effectValidator)
Parameters
Type | Name | Description |
---|---|---|
RenderContext | context | |
EffectValidator | effectValidator |