Particle Material Property Delta Engine Documentation

Namespace: DeltaEngine.Rendering3D.Particles
Assembly: DeltaEngine.Rendering3D.Particles (in DeltaEngine.Rendering3D.Particles.dll) Version: 1.1.1.0 (1.1.1)
Syntax

public Material Material { get; set; }

Property Value

Type: Material
Remarks

Tests: DeltaEngine.Rendering3D.Particles.Tests.Particle2DEmitterTests
Examples

3 unit tests call DeltaEngine.Rendering3D.Particles.Particle.Material
[Test, CloseAfterFirstFrame]
public void ParticleWithNoMaterialThrowsException()
{
    emitterData = CreateDataAndEmitterWithAnimation("DeltaEngineLogo");
    emitterData.ParticleMaterial = null;
    Assert.Throws<ParticleEmitter.UnableToCreateWithoutMaterial>(
        () => new ParticleEmitter(emitterData, new Vector2D(0.5f, 0.5f)));
}
[Test]
public void SwitchMaterialsOfParticles()
{
    var emitterData = GetEmitterData(logo);
    emitterData.ParticleMaterial.DiffuseMap.BlendMode = BlendMode.Additive;
    var emitter = new ParticleEmitter(emitterData, Vector3D.Zero);
    AdvanceTimeAndUpdateEntities();
    emitter.particles[0].Material = new Material(ShaderFlags.ColoredTextured, "ParticleSpark");
    emitterData.ParticleMaterial.DiffuseMap.BlendMode = BlendMode.Additive;
    AdvanceTimeAndUpdateEntities();
}
[Test]
public void MultipleEmittersDifferentMaterials()
{
    new ParticleEmitter(GetEmitterData(logo), Vector3D.Zero);
    new ParticleEmitter(GetEmitterData(spark), Vector3D.UnitX);
}
See Also