Gorilla.Particle.Eruption Unit Reference

Pre-configured volcanic eruption particle emitter with lava projectiles.

TGorillaEruptionParticleEmitter

Realistic volcanic eruption effect with upward-launching lava particles.

Inheritance: TGorillaParticleEmitter → TGorillaEruptionParticleEmitter

Platforms: All Gorilla platforms

Unit: Gorilla.Particle.Eruption

Constructor/Destructor

Create

constructor Create(AOwner: TComponent); override;

Creates eruption emitter with preconfigured settings:

  • Strong upward velocity
  • Gravity influence for arc trajectory
  • Continuous emission
  • Large particle count support

Destroy

destructor Destroy(); override;

Cleans up eruption emitter resources.

Properties

Gravity (Read-Only)

property Gravity: TGorillaGravityParticleInfluencer read FGravity;

Integrated gravity influencer for lava arc trajectories.

Default: Earth gravity (9.81 m/s²)

Usage:

// Stronger gravity (faster fall)
LEruption.Gravity.Ratio := 0.02;

// Weaker gravity (longer flight)
LEruption.Gravity.Ratio := 0.005;

ParticleMaterial (Read-Only)

property ParticleMaterial: TGorillaParticleMaterialSource read GetParticleMaterial;

Attached particle material source for lava textures.

Default Configuration

The eruption emitter is preconfigured with these settings:

Property Value Description
EmitParticles 100 Particles per interval
MaxParticles 10000 Maximum active particles
EmitTime 16ms ~60 FPS updates
AutoEmit True Continuous emission
Reuse True Particle caching enabled
ParticleSize 2 Uniform lava chunks
ParticleGrowth 0 No growth
ParticleLifeTime 0.5-5 seconds Lifetime range
ParticleWeight 1.0 Uniform weight
SpriteSheet 7×7 Animated sprites

Velocity Configuration:

  • Y-axis: 0.0981 - 0.1981 (strong upward)
  • X/Z-axis: ±0.05 (horizontal spread)
  • Direction: (1, -1.5, 1) - Upward cone

Integrated Influencers

  • TGorillaGravityParticleInfluencer - Creates realistic arc trajectories

Examples

Basic Eruption

var
  LEruption: TGorillaEruptionParticleEmitter;
begin
  LEruption := TGorillaEruptionParticleEmitter.Create(Self);
  LEruption.Parent := GorillaViewport1;
  LEruption.Camera := Camera1;
  LEruption.Position.Point := Point3D(0, 0, 0);

  LEruption.Start();
end;

Violent Eruption

var
  LViolent: TGorillaEruptionParticleEmitter;
begin
  LViolent := TGorillaEruptionParticleEmitter.Create(Self);
  LViolent.Parent := GorillaViewport1;
  LViolent.Camera := Camera1;

  // More particles
  LViolent.EmitParticles := 200;
  LViolent.MaxParticles := 15000;

  // Higher velocity
  LViolent.ParticleVelocity.RangeY.Preset(1500, 3000, 10000, False);

  // Wider spread
  LViolent.ParticleVelocity.RangeX.Preset(0, 100, 1000, True);
  LViolent.ParticleVelocity.RangeZ.Preset(0, 100, 1000, True);

  // Larger chunks
  LViolent.ParticleSize.Preset(3, 5, 1, False);

  LViolent.Start();
end;

Gentle Eruption

var
  LGentle: TGorillaEruptionParticleEmitter;
begin
  LGentle := TGorillaEruptionParticleEmitter.Create(Self);
  LGentle.Parent := GorillaViewport1;
  LGentle.Camera := Camera1;

  // Fewer particles
  LGentle.EmitParticles := 30;
  LGentle.MaxParticles := 3000;

  // Lower velocity
  LGentle.ParticleVelocity.RangeY.Preset(500, 1000, 10000, False);

  // Narrow spread
  LGentle.ParticleVelocity.RangeX.Preset(0, 20, 1000, True);
  LGentle.ParticleVelocity.RangeZ.Preset(0, 20, 1000, True);

  // Smaller particles
  LGentle.ParticleSize.Preset(1, 2, 1, False);

  LGentle.Start();
end;

Geyser Effect

var
  LGeyser: TGorillaEruptionParticleEmitter;
begin
  LGeyser := TGorillaEruptionParticleEmitter.Create(Self);
  LGeyser.Parent := GorillaViewport1;
  LGeyser.Camera := Camera1;

  // Vertical column only
  LGeyser.ParticleVelocity.RangeX.Preset(0, 5, 1000, True);
  LGeyser.ParticleVelocity.RangeZ.Preset(0, 5, 1000, True);
  LGeyser.ParticleVelocity.Direction.Point := Point3D(0, -1, 0);

  // High velocity
  LGeyser.ParticleVelocity.RangeY.Preset(2000, 2500, 10000, False);

  // Small emission area
  LGeyser.ParticlePosition.Preset(0, 10, 1000, Point3D(1, 1, 1), [axX, axZ]);

  // Use blue/white for water
  // (Would need custom color influencer)

  LGeyser.Start();
end;

Intermittent Eruption

var
  LIntermittent: TGorillaEruptionParticleEmitter;
  LTimer: TTimer;
  LActive: Boolean;
begin
  LIntermittent := TGorillaEruptionParticleEmitter.Create(Self);
  LIntermittent.Parent := GorillaViewport1;
  LIntermittent.Camera := Camera1;
  LIntermittent.AutoEmit := False;

  LActive := False;

  // Toggle eruption every 3 seconds
  LTimer := TTimer.Create(Self);
  LTimer.Interval := 3000;
  LTimer.OnTimer := procedure(Sender: TObject)
  begin
    LActive := not LActive;
    LIntermittent.AutoEmit := LActive;

    if LActive then
      LIntermittent.Start()
    else
      LIntermittent.Stop();
  end;
  LTimer.Enabled := True;

  LIntermittent.Start();
end;

Lava Fountain

var
  LFountain: TGorillaEruptionParticleEmitter;
begin
  LFountain := TGorillaEruptionParticleEmitter.Create(Self);
  LFountain.Parent := GorillaViewport1;
  LFountain.Camera := Camera1;
  LFountain.Position.Point := Point3D(0, 0, 0);

  // Many particles
  LFountain.EmitParticles := 150;
  LFountain.MaxParticles := 8000;

  // Moderate velocity
  LFountain.ParticleVelocity.RangeY.Preset(1000, 1500, 10000, False);

  // Circular spread
  LFountain.ParticleVelocity.RangeX.Preset(0, 60, 1000, True);
  LFountain.ParticleVelocity.RangeZ.Preset(0, 60, 1000, True);

  // Additive blending for glow
  LFountain.BlendFunc := TBlendEquationFunc.befAdd;
  LFountain.BlendSource := TBlendFactor.bfOne;
  LFountain.BlendDest := TBlendFactor.bfOne;

  LFountain.Start();
end;

Controlled Burst

var
  LBurst: TGorillaEruptionParticleEmitter;
begin
  LBurst := TGorillaEruptionParticleEmitter.Create(Self);
  LBurst.Parent := GorillaViewport1;
  LBurst.Camera := Camera1;

  // Single burst
  LBurst.EmitParticles := 500;
  LBurst.MaxAutoEmitTime := 100;  // 0.1 second burst

  // Very high velocity
  LBurst.ParticleVelocity.RangeY.Preset(2500, 3500, 10000, False);

  // Large spread
  LBurst.ParticleVelocity.RangeX.Preset(0, 150, 1000, True);
  LBurst.ParticleVelocity.RangeZ.Preset(0, 150, 1000, True);

  LBurst.Start();
end;

Tips

Performance

  • High MaxParticles (10,000) requires good hardware
  • Use async mode for best performance
  • Reduce EmitParticles on mobile devices
  • Consider limiting visible distance

Visual Quality

  • Combine with fire/smoke emitters
  • Add glow/light at eruption source
  • Use additive blending for hot lava
  • Add sound effects for realism

Realism

  • Vary particle velocity for natural look
  • Use gravity for realistic arcs
  • Match emission area to volcano size
  • Add ground impact effects

Configuration Tips

Velocity vs Gravity:

  • High velocity + normal gravity = high arcs
  • Low velocity + strong gravity = short arcs
  • Balanced = realistic lava trajectory

Spread Pattern:

  • Equal X/Z spread = circular
  • Directional spread = targeted eruption
  • Minimal spread = geyser column

Common Combinations

Eruption with Lava Flow

var
  LEruption: TGorillaEruptionParticleEmitter;
  LFlow: TGorillaParticleEmitter;
begin
  LEruption := TGorillaEruptionParticleEmitter.Create(Self);
  LEruption.Start();

  // Ground lava flow
  LFlow := TGorillaParticleEmitter.Create(Self);
  LFlow.Parent := GorillaViewport1;
  LFlow.Position.Y := 0;

  // Horizontal spread
  LFlow.ParticleVelocity.RangeX.Preset(0, 30, 1000, True);
  LFlow.ParticleVelocity.RangeZ.Preset(0, 30, 1000, True);
  LFlow.ParticleVelocity.RangeY.Preset(0, 0, 1, False);

  LFlow.Start();
end;

Eruption with Smoke

var
  LEruption: TGorillaEruptionParticleEmitter;
  LSmoke: TGorillaSmokeParticleEmitter;
begin
  LEruption := TGorillaEruptionParticleEmitter.Create(Self);
  LEruption.Start();

  // Volcanic smoke
  LSmoke := TGorillaSmokeParticleEmitter.Create(Self);
  LSmoke.Parent := GorillaViewport1;
  LSmoke.Position := LEruption.Position;
  LSmoke.Kind := TGorillaSmokeParticleKind.Style3;

  // Dark smoke
  LSmoke.Colored.StartColorF := TAlphaColorF.Create(0.2, 0.2, 0.2, 0.8);
  LSmoke.Colored.EndColorF := TAlphaColorF.Create(0.1, 0.1, 0.1, 0.0);

  LSmoke.Start();
end;

Eruption with Impact Particles

var
  LEruption: TGorillaEruptionParticleEmitter;
  LImpact: TGorillaSpotParticleEmitter;
begin
  LEruption := TGorillaEruptionParticleEmitter.Create(Self);
  LEruption.Start();

  // Ground impacts
  LImpact := TGorillaSpotParticleEmitter.Create(Self);
  LImpact.Parent := GorillaViewport1;
  LImpact.Position.Y := 0;

  // Could be triggered when lava particles hit ground
  // (requires custom collision detection)
end;

Physics Considerations

Trajectory Calculation

The default settings approximate realistic lava trajectories:

  • Initial velocity: ~10-20 m/s upward
  • Gravity: 9.81 m/s² downward
  • Horizontal spread: ±5 m/s

Performance Notes

  • 10,000 particles can be demanding
  • Enable async mode: LEruption.Async := True
  • Monitor framerate and adjust MaxParticles
  • Consider particle culling for distant views

See Also