Gorilla.Particle.Waterfall Unit Reference

Pre-configured waterfall particle emitter with cascading water effect.

TGorillaWaterfallParticleEmitter

Realistic waterfall effect with forward projection and gravity.

Inheritance: TGorillaParticleEmitter → TGorillaWaterfallParticleEmitter

Platforms: All Gorilla platforms

Unit: Gorilla.Particle.Waterfall

Constructor/Destructor

Create

constructor Create(AOwner: TComponent); override;

Creates waterfall emitter with preconfigured settings:

  • Forward and downward motion
  • Growing particles
  • Blue to transparent color transition
  • Gravity influencer

Destroy

destructor Destroy(); override;

Cleans up waterfall emitter resources.

Properties

SpawnSize

property SpawnSize: Single;

Relative spawning area size (0.0 - 1.0) from top of emitter downwards.

Default: 0.05 (5% of emitter height)

Usage:

// Spawn in top 10% of emitter
LWaterfall.SpawnSize := 0.1;

Power

property Power: Single;

Water projection power controlling Z-axis expansion.

Default: 0.025

Range: 0.0 - 1.0

Usage:

// Stronger water projection
LWaterfall.Power := 0.05;

// Weak projection (straight down)
LWaterfall.Power := 0.01;

Note: Zero power makes particles fall straight down like rain.

Spread

property Spread: Single;

Horizontal spreading of particles on X-axis.

Default: 0.05

Range: 0.0 - 1.0

Usage:

// Wide waterfall
LWaterfall.Spread := 0.1;

// Narrow stream
LWaterfall.Spread := 0.02;

Speed

property Speed: Single;

Falling speed on Y-axis, boosting gravity influence.

Default: 0.1

Range: 0.0 - 1.0

Usage:

// Faster waterfall
LWaterfall.Speed := 0.2;

// Slower cascade
LWaterfall.Speed := 0.05;

Colored (Read-Only)

property Colored: TGorillaColoredParticleInfluencer read FColored;

Integrated color influencer for water color transition.

Default: Blue to transparent

Usage:

// Change water color
LWaterfall.Colored.StartColorF := TAlphaColorF.Create(0.0, 0.8, 1.0, 0.9);  // Cyan
LWaterfall.Colored.EndColorF := TAlphaColorF.Create(0.0, 0.5, 0.8, 0.0);    // Dark cyan fade

ParticleMaterial (Read-Only)

property ParticleMaterial: TGorillaParticleMaterialSource read GetParticleMaterial;

Attached particle material source for water textures.

Default Configuration

The waterfall emitter is preconfigured with these settings:

Property Value Description
EmitParticles 100 Particles per interval
MaxParticles 2500 Maximum active particles
EmitTime 16ms ~60 FPS updates
AutoEmit True Automatic emission
Reuse True Particle caching enabled
ParticleSize 4-16 Water droplet size
ParticleGrowth 1-2 Growing particles
ParticleLifeTime 2.5-5 seconds Lifetime range
UseLighting True Affected by scene lighting
SpriteSheet 4×4 Animated sprites

Integrated Influencers

  • TGorillaGravityParticleInfluencer - Downward gravity
  • TGorillaColoredParticleInfluencer - Blue to transparent fade

Examples

Basic Waterfall

var
  LWaterfall: TGorillaWaterfallParticleEmitter;
begin
  LWaterfall := TGorillaWaterfallParticleEmitter.Create(Self);
  LWaterfall.Parent := GorillaViewport1;
  LWaterfall.Camera := Camera1;

  // Position at cliff edge
  LWaterfall.Position.Point := Point3D(0, 10, 0);

  // Size of water source
  LWaterfall.Width := 3;
  LWaterfall.Depth := 1;
  LWaterfall.Height := 0.5;

  LWaterfall.Start();
end;

Large Waterfall

var
  LLargeWaterfall: TGorillaWaterfallParticleEmitter;
begin
  LLargeWaterfall := TGorillaWaterfallParticleEmitter.Create(Self);
  LLargeWaterfall.Parent := GorillaViewport1;
  LLargeWaterfall.Camera := Camera1;
  LLargeWaterfall.Position.Point := Point3D(0, 20, 0);

  // Wide waterfall
  LLargeWaterfall.Width := 10;
  LLargeWaterfall.Depth := 2;

  // More particles
  LLargeWaterfall.EmitParticles := 200;
  LLargeWaterfall.MaxParticles := 5000;

  // Strong projection
  LLargeWaterfall.Power := 0.04;
  LLargeWaterfall.Spread := 0.08;
  LLargeWaterfall.Speed := 0.15;

  LLargeWaterfall.Start();
end;

Small Stream

var
  LStream: TGorillaWaterfallParticleEmitter;
begin
  LStream := TGorillaWaterfallParticleEmitter.Create(Self);
  LStream.Parent := GorillaViewport1;
  LStream.Camera := Camera1;

  // Narrow stream
  LStream.Width := 0.5;
  LStream.Depth := 0.3;

  // Fewer particles
  LStream.EmitParticles := 30;
  LStream.MaxParticles := 800;

  // Gentle flow
  LStream.Power := 0.015;
  LStream.Spread := 0.02;
  LStream.Speed := 0.08;

  // Smaller droplets
  LStream.ParticleSize.Preset(2, 8, 1, False);

  LStream.Start();
end;

Fountain

var
  LFountain: TGorillaWaterfallParticleEmitter;
begin
  LFountain := TGorillaWaterfallParticleEmitter.Create(Self);
  LFountain.Parent := GorillaViewport1;
  LFountain.Camera := Camera1;
  LFountain.Position.Y := 0;

  // Circular base
  LFountain.Width := 1;
  LFountain.Depth := 1;

  // Upward initial velocity
  LFountain.ParticleVelocity.RangeY.Preset(-200, -300, 1000, False);

  // Outward spread
  LFountain.ParticleVelocity.RangeX.Preset(0, 100, 1000, True);
  LFountain.ParticleVelocity.RangeZ.Preset(0, 100, 1000, True);

  // Disable forward power
  LFountain.Power := 0;

  // Strong gravity to pull down
  LFountain.Gravity.Ratio := 0.03;

  LFountain.Start();
end;

Rapid Cascade

var
  LCascade: TGorillaWaterfallParticleEmitter;
begin
  LCascade := TGorillaWaterfallParticleEmitter.Create(Self);
  LCascade.Parent := GorillaViewport1;
  LCascade.Camera := Camera1;
  LCascade.Position.Point := Point3D(0, 15, 0);

  LCascade.Width := 5;
  LCascade.Depth := 1.5;

  // Very fast falling
  LCascade.Speed := 0.25;
  LCascade.Gravity.Ratio := 0.02;

  // Strong projection
  LCascade.Power := 0.06;

  // Many particles
  LCascade.EmitParticles := 150;
  LCascade.MaxParticles := 4000;

  LCascade.Start();
end;

Gentle Trickle

var
  LTrickle: TGorillaWaterfallParticleEmitter;
begin
  LTrickle := TGorillaWaterfallParticleEmitter.Create(Self);
  LTrickle.Parent := GorillaViewport1;
  LTrickle.Camera := Camera1;

  // Very narrow
  LTrickle.Width := 0.2;
  LTrickle.Depth := 0.2;

  // Few particles
  LTrickle.EmitParticles := 10;
  LTrickle.MaxParticles := 300;

  // Weak flow
  LTrickle.Power := 0.01;
  LTrickle.Spread := 0.01;
  LTrickle.Speed := 0.05;

  // Tiny droplets
  LTrickle.ParticleSize.Preset(1, 4, 1, False);

  LTrickle.Start();
end;

Tips

Performance

  • Adjust MaxParticles based on waterfall size
  • Consider async mode for large waterfalls (> 3000 particles)
  • Reduce EmitParticles for distant waterfalls

Visual Quality

  • Position emitter at water source edge
  • Match emitter width to visual water source
  • Use lighting (UseLighting = True) for realism
  • Combine with mist/fog effects

Realism

  • Adjust Power for waterfall arc
  • Use Spread for natural water dispersal
  • Vary Speed based on height and volume
  • Add sound effects for immersion

Configuration

Power vs Spread:

  • High Power + Low Spread = Focused jet
  • Low Power + High Spread = Wide curtain
  • Balanced = Natural waterfall

Speed vs Gravity:

  • High Speed = Fast cascade
  • Low Speed + High Gravity = Gentle fall
  • Balanced = Realistic flow

Common Combinations

Waterfall with Mist

var
  LWaterfall: TGorillaWaterfallParticleEmitter;
  LMist: TGorillaSmokeParticleEmitter;
begin
  LWaterfall := TGorillaWaterfallParticleEmitter.Create(Self);
  // Configure waterfall...

  // Add mist at base
  LMist := TGorillaSmokeParticleEmitter.Create(Self);
  LMist.Parent := GorillaViewport1;
  LMist.Position := LWaterfall.Position;
  LMist.Position.Y := 0;  // Bottom of waterfall

  // White mist
  LMist.Colored.StartColorF := TAlphaColorF.Create(0.9, 0.9, 1.0, 0.3);
  LMist.Colored.EndColorF := TAlphaColorF.Create(0.8, 0.8, 0.9, 0.0);

  LWaterfall.Start();
  LMist.Start();
end;

See Also