Class ParticleMaterialSimple
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
- Inheritance
-
ParticleMaterialSimple
- Derived
- Inherited Members
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
FaceCulling
Allows the particle shape to be back- or front-face culled.
[DataMember(40)]
[Display("Culling", null)]
public ParticleMaterialCulling FaceCulling { get; set; }
Property Value
HasColorField
Indicates if this material requires a color field in the vertex stream
protected bool HasColorField { get; }
Property Value
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
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
Methods
ForceUpdate()
Forces the material update, potentionally recreating the effect
public override void ForceUpdate()
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
ParticleBufferStateThe particle buffer state which is used to build the assigned vertex buffer
invViewX
Vector3Unit vector X (right) in camera space, extracted from the inverse view matrix
invViewY
Vector3Unit vector Y (up) in camera space, extracted from the inverse view matrix
sorter
ParticleListParticle enumerator which can be iterated and returns sported particles
PrepareVertexLayout(ParticlePoolFieldsList)
Prepares the material for drawing the current frame with the current ParticleVertexBuilder and ParticleList
public override void PrepareVertexLayout(ParticlePoolFieldsList fieldsList)
Parameters
fieldsList
ParticlePoolFieldsListA container for the ParticlePool which can poll if a certain field exists as an attribute
Setup(RenderContext)
Setups the current material using the graphics device.
public override void Setup(RenderContext context)
Parameters
context
RenderContext
SetupPipeline(RenderContext, PipelineStateDescription)
Setup the pipeline state object.
public override void SetupPipeline(RenderContext renderContext, PipelineStateDescription pipelineState)
Parameters
renderContext
RenderContextpipelineState
PipelineStateDescription
ValidateEffect(RenderContext, ref EffectValidator)
public override void ValidateEffect(RenderContext context, ref EffectValidator effectValidator)
Parameters
context
RenderContexteffectValidator
EffectValidator