๐ Niagara VFX Integration - Water-Aware Particle Systems
ยท 3 min read
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:
| Property | Description |
|---|---|
| bFindWaterBodyOnSpawn | Automatically locate nearest water body when system spawns |
| bEvaluateSystemDepth | Sample water depth at system position |
| bEvaluateSystemDepthPerFrame | Update depth sampling every frame |
| SourceBodyComponent | Explicit 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:
| Data | Description |
|---|---|
| Wave Height | Current water surface height at particle XY |
| Wave Normal | Surface normal for orientation |
| Flow Velocity | Water movement direction and speed |
| Depth | Distance from surface to ground |
| Submersion | Particle 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โ
- Create Niagara System with Water Data Interface
- Configure Source - Set SourceBodyComponent or enable auto-find
- Add Modules - Use water data in particle behavior
- 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โ
| Feature | Status |
|---|---|
| GPU Simulation Support | Planned |
| Wave Spectrum Access | Planned |
| Shore Distance Queries | Planned |
| Foam Threshold Data | Planned |
Resourcesโ
- Discord: Join #vfx-integration for community effects
- Example Systems: Available in plugin Content folder
- Documentation: See Niagara module reference