Search Results for

    Show / Hide Table of Contents

    Create Particle Systems


    Particles header

    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 Plus Icon button in the Assets Details panel to deploy the create menu options and clicking on the option "Create particles"

    Create new particle system menu option

    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.

    Material asset

    Particle System files in content directory

    The particle system file has the .weps extension.

    Material file

    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);
    
    In this article
    Back to top
    Generated by DocFX