Skip to main content

๐ŸŽ† Niagara VFX Integration - Water-Aware Particle Systems

ยท 3 min read
Galidar
Founder, Galidar Studio

Deep integration between Oceanology and Unreal Engine's Niagara VFX system enables physically-accurate water-aware particle effects.

Overviewโ€‹

The Niagara Water Data Interface provides direct access to Oceanology's wave simulation data within Niagara particle systems. This enables VFX artists to create effects that respond naturally to water surface dynamics.


Niagara Data Interfaceโ€‹

UOceanologyNiagaraDataInterfaceWaterโ€‹

The core integration component exposes water simulation data to Niagara:

PropertyDescription
bFindWaterBodyOnSpawnAutomatically locate nearest water body when system spawns
bEvaluateSystemDepthSample water depth at system position
bEvaluateSystemDepthPerFrameUpdate depth sampling every frame
SourceBodyComponentExplicit water component reference

Available Functionsโ€‹

// Get complete water data at world position
void GetWaterDataAtPoint(FVectorVMExternalFunctionContext& Context);

// Access wave parameter lookup table
void GetWaveParamLookupTableOffset(FVectorVMExternalFunctionContext& Context);

Water Data Accessโ€‹

Per-Particle Queriesโ€‹

Each particle can query water state independently:

DataDescription
Wave HeightCurrent water surface height at particle XY
Wave NormalSurface normal for orientation
Flow VelocityWater movement direction and speed
DepthDistance from surface to ground
SubmersionParticle depth below water surface

Performance Considerationsโ€‹

  • CPU simulation only (ENiagaraSimTarget::CPUSim)
  • Supports instance data caching
  • Automatic water body change detection via SourceBodyChangeId
  • Pre-simulate tick for data preparation

Niagara Function Libraryโ€‹

Blueprint Accessible Functionsโ€‹

UCLASS()
class UOceanologyNiagaraWaterFunctionLibrary : public UBlueprintFunctionLibrary
{
// Set water component for Niagara system
UFUNCTION(BlueprintCallable, Category = "Oceanology|Niagara")
static void SetOceanologyWaterComponent(
UNiagaraComponent* NiagaraComponent,
UOceanologyWaterComponent* WaterComponent
);
};

Use Casesโ€‹

Spray & Splash Effectsโ€‹

Create spray particles that:

  • Spawn at wave crests (high curvature areas)
  • Orient along wave normals
  • Scale intensity with wave height
  • Follow flow velocity

Foam Particlesโ€‹

Dynamic foam that:

  • Accumulates in high-turbulence zones
  • Dissipates based on water calm areas
  • Follows surface flow direction
  • Responds to shore proximity

Underwater Bubblesโ€‹

Bubble systems that:

  • Rise toward water surface
  • Account for current wave height
  • Respond to depth pressure
  • Interact with flow velocity

Wake Effectsโ€‹

Boat/character wakes that:

  • Sample surface at multiple points
  • Generate V-shaped spray patterns
  • Scale with movement speed
  • Fade with distance

Integration Exampleโ€‹

Setting Up Water-Aware Particlesโ€‹

  1. Create Niagara System with Water Data Interface
  2. Configure Source - Set SourceBodyComponent or enable auto-find
  3. Add Modules - Use water data in particle behavior
  4. Sample Per-Particle - Query wave height, normal, velocity

Module Setupโ€‹

Particle Spawn:
- Sample Water Height at Particle.Position.XY
- Set Particle.Position.Z = WaterHeight + Offset

Particle Update:
- Sample Flow Velocity
- Add to Particle.Velocity
- Orient sprite to Water Normal

Debuggingโ€‹

Editor Visualizationโ€‹

Enable WITH_NIAGARA_DEBUGGER for HUD overlays:

  • Water body boundaries
  • Sample positions
  • Flow vectors
  • Depth values

Upcoming Enhancementsโ€‹

FeatureStatus
GPU Simulation SupportPlanned
Wave Spectrum AccessPlanned
Shore Distance QueriesPlanned
Foam Threshold DataPlanned

Resourcesโ€‹

  • Discord: Join #vfx-integration for community effects
  • Example Systems: Available in plugin Content folder
  • Documentation: See Niagara module reference