AgentSkillsCN

Niagara

在Unreal Engine中创建Niagara粒子系统,或对视觉特效进行组织与优化。

SKILL.md
--- frontmatter
description: Creating Niagara particle systems or organizing VFX in Unreal Engine

UE5 Niagara

Best practices for Niagara visual effects in Unreal Engine 5.

Naming Convention

PrefixAsset Type
NS_Niagara System
NE_Niagara Emitter
NM_Niagara Module
NDI_Niagara Data Interface

Examples: NS_Explosion_Fire, NE_Sparks_Burst, NM_ScaleBySpeed

Critical Rule

No spaces in identifiers - HLSL compatibility requires underscore-separated names.

code
# CORRECT
NS_Fire_Explosion_Large
NE_Smoke_Wispy

# WRONG
NS Fire Explosion Large
NE Smoke Wispy

System Architecture

code
Niagara System (NS_)
├── Emitter 1 (NE_)
│   └── Module Stack
├── Emitter 2 (NE_)
│   └── Module Stack
└── Emitter 3 (NE_)
    └── Module Stack

Systems contain emitters - emitters cannot be placed in levels alone.

Module Stack Order

Modules process top-to-bottom within each stage:

code
Emitter Update
├── Emitter State
└── Spawn Rate

Particle Spawn
├── Initialize Particle
├── Set Position
└── Set Velocity

Particle Update
├── Apply Forces
├── Update Color
└── Scale By Lifetime

Render
└── Sprite Renderer

Emitter Naming in Multi-Emitter Systems

Use descriptive names within systems:

code
NS_Explosion_Fire
├── Fire_Core           # Central fire burst
├── Fire_Secondary      # Outer flames
├── Smoke_Dark          # Dark smoke plume
├── Smoke_Light         # Lighter dissipating smoke
├── Sparks_Burst        # Initial spark burst
├── Sparks_Trailing     # Lingering sparks
└── Debris_Chunks       # Physical debris

Organization

Use tags for asset organization in Niagara browser:

TagPurpose
EnvironmentEnvironmental effects
CombatWeapon/damage effects
CharacterCharacter-related VFX
UIInterface effects
AmbientBackground/atmosphere

Performance

PracticeBenefit
GPU simulationBetter performance for large counts
Bounded emittersCulling optimization
LOD settingsDistance-based quality
Fixed boundsAvoid recalculation
PoolingReduce spawn overhead

GPU vs CPU Simulation

GPU SimulationCPU Simulation
Large particle countsComplex logic
Simple behaviorCollision queries
Better scalabilityEvent handling
Distance field collisionPrecise physics

Best Practices

PracticeReason
Descriptive emitter namesClarity in complex systems
Use inheritanceShare common emitter setups
Set explicit boundsPerformance
Profile with Niagara DebuggerIdentify bottlenecks
Use LODsQuality/performance scaling

Common Modules

ModulePurpose
Initialize ParticleSet initial state
Add VelocityMovement direction
Gravity ForcePhysics simulation
DragAir resistance
Scale ColorColor over lifetime
Scale Sprite SizeSize over lifetime
Curl Noise ForceOrganic movement

Documentation: https://dev.epicgames.com/documentation/en-us/unreal-engine/overview-of-niagara-effects-for-unreal-engine