UE5 Niagara Advanced Example Reading Note

本文介绍了如何在UnrealEngine5的Niagara系统中使用SimulationStage、Grid3D、PBD和SDF等技术进行高级粒子效果的创建,包括定制生命周期、纹理采样、渲染目标操作以及与外部系统交互等内容。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

It is an reading note of UE5 Niagara Advanced Example, related about usage of Simulation Stage, Grid 3D, PBD, SDF and so on.

The article can’t cover all details, it just a reading note. Implementation details are so complex that it is recommended to have a look on original source.

In offical showcase project ContentExample, you can see detailed comment in Niagara System examples.

Niagara_Particles level is about basic of Niagara, here we assume readers have read it. This article mostly focus on Niagara_Advanced_Particles level.

There is also some offical tutorial:

Advanced Niagara Effects Inside Unreal

1.1 What is simulation stage

Niagara System: FIllRenderTarget.

If you need custom lifetime hook, that is my personal understanding, or in their way, stack, you should add Simulation Stage.

Enable Simulation Stages on a GPU emitter by checking “Enable Simulation Stages” in advanced emitter properties

That is weird, I can’t find Enable Simulation Stages in emitter properties, even in their example. So I leave it alone.

Fig: Cannot Find Enable Sim

You can’t create a lifetime for arbitrary usage, UE set Simulation Stage is a For loop.

Think of a simulation stage as an additional “stack” like Particle Update. The difference is it can iterate, meaning run multiple times on a single frame across all the elements in it.Think of it like a “For Loop” in the stack.

It is also unique because its “Iteration source” can be more than just particles. A Simulation Stage can iterate over every grid cell in a Grid 2d collection to create solvers, iterate over every pixel in a render target to write to it, or iterate over every particle.

Then you know:

  1. Simulation Stage is like Particle Update, it is called per frame.

  2. It is a basic operation For loop.

As for this example, you can see how it iterate all texels of render target, calc UV of render target by iteration index, sample from a texture according to this UV.

Once you know this, you will know the input and output of Simulation Stage. Input is your Niagara System parameters, and you can expose some build-in anyway. Output is void. So Simulation Stage is a function void update(user parameters).

1.2 Advect 2d Collection

Niagara System: AdvectGrid.

This example is mainly about how to sample from 2D Texture and store it into RenderTarget.

If you need some cool effect, fill RenderTarget and change sampling UV or something in Simulation Stage.

Considering adverting fluid-like emitter, I guessed it is implementing famous paper Stable Fluid at the first time. But after I click into the emitter, I found it only have two steps: diffuse and advect. These two module are completely different from what I know from Stable Fluid. Diffusion is made by simply averaging nearby four grids, advection is made by random UV offset, or in other word, random advection velocity.

How to expose variable in module to Niagara System

When I try to reproduce the work, I find my new variable created in module doesn’t appear in Niagara System Parameters window. After several tries, I find the reason that new variable must be a pin of Map get or Map set, only then it can appear in Niagara System Parameters window.

I don’t know clearly why. Maybe it is a optimation by UE, that variable which reference = 0 is auto invisib

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值