一,Niagara Lightweight Emitters Overview
UE5.4引入Niagara轻量级发射器,也称无状态发射器,经优化以最小化模拟过程中的tick使用;轻量级发射器不用编译,有更快的工作流程,发射器数量对性能影响较小;大多数情况下,无状态发射器的性能会显著优于有状态的传统发射器;可同时有两种状态的发射器;
引入无状态发射器的主要动机是为了降低Niagara的内存和 CPU 成本,并加快开发时间;
- Reduce Game Thread tick cost
- Remove the concurrent tick cost
- Reduce Render Thread cost
- Reduce memory cost
- Removesperformance impactofemitter countandparticle instance count
- Reduce(and sometimes remove) the need forcompilation
为提升性能,无状态发射器只能访问以下模块:
- Acceleration Force
- Add Velocity
- Curl Noise / Noise Vector Field
- Drag
- Gravity Force
- Initialize Particle
- Initial Mesh Orientation
- Rotate Around Point
- Scale Color
- Scale Mesh Size
- Scale Mesh Size By Speed
- Scale Sprite Size
- Scale Sprite Size By Speed
- Shape Location
- Solve Velocities And Forces
- Sprite Rotation Rate
- Sub UV Animation
可调整每个可用模块的设置,但不能创建自定义模块,scratchpads,dynamic inputs;当前可通过C++扩展,有状态和无状态可相互转换;
二,普通发射器和轻量级发射器对比
使用 Niagara Debugger 对比性能;
使用控制台命令 stat UNIT 对比