Create Particle Systems
Particle systems simulate and render a large number of quads called particles.
Create a Particle System asset in Evergine Studio
You can create a material by clicking on the button in the Assets Details panel to deploy the create menu options and clicking on the option "Create particles"
Inspect Particle Systems in Asset Details
You can find the particle system assets in the Assets Details panel when you select a folder in the Project Explorer.
Particle System files in content directory
The particle system file has the .weps
extension.
Create a new Particle System from code
The following sample code can be used to create a new particle system and apply it to an entity in your scene:
var assetsService = Application.Current.Container.Resolve<AssetsService>();
var graphicsContext = Application.Current.Container.Resolve<GraphicsContext>();
// Sets its particle emitter.
ParticleEmitterDescription emitterDesc = new ParticleEmitterDescription()
{
ParticleTexture = EvergineContent.Textures.particle_png,
ParticleSampler = EvergineContent.Samplers.LinearClampSampler,
RenderLayer = EvergineContent.RenderLayers.Alpha,
MaxParticles = 1000,
InitLife = 2,
InitSpeed = 1,
InitSize = 0.1f,
InitColor = Color.Red,
};
ParticlesEmitter emitter = new ParticlesEmitter(emitterDesc, graphicsContext, assetsService);
// Creates the asset and sets its emitter.
ParticleSystem particleSystem = new ParticleSystem();
particleSystem.AddEmitter(emitter);