Niagara_Particles official case of UE4/5Niagara particle effects: 3.3->4.3

Table of contents

3.3 Visibility Tag

 Emitter on the left:

launcher update

particle generation

 particle update

 right transmitter

Differences from the transmitter on the left

3.4 Texture Sampling

 launcher update

 particle generation

particle update

4.1Play Audio Per Particle

 system

third launcher

launcher update 

particle generation

 particle update

second transmitter

launcher update

 particle generation

 particle update

 Another emitter after the death event spawns

first launcher 

 another launcher

 4.2 Renderers With No Particles

 4.3 Mesh Orientation vs. Rotational Force

launcher one

​Edit launcher two

launcher three


3.3 Visibility Tag

 Judging from the performance of special effects and the state of opening, the No. 1 launcher is on the left, and the No. 2 launcher is on the right.

What is the difference between the left and right sides? If you look closely, you can find:

On the left is the emitter which randomly generates particles and models.

The emitter on the right changes its rendering state in a certain order according to the life cycle.

 Emitter on the left:

launcher update

Spawn Rate is 3 per second.

particle generation

Then there is initialization.

It can be seen that the life cycle is between 1.65-2 seconds

Then the color is between a transparent color and white, which is why the particles [not models] we see are somewhat transparent.

Then the initial size of the particles is 21, while the model is normal 1.

 Above is the generated range, circle 60.

The following is the offset, which means that the position of NS is offset by -125° to the x-axis.

That's why this launcher is on the left.

 This is the direction to initialize the model.

You can see that the Visibility Tag is set here at the end, with a random integer between 0-3.

As you can see from the renderer below, the visibility tags of all renderers are this Visibility Tag.

 

 particle update

The value of drag is 1.371139 [reduce linear speed]

Cur Noise Force Vortex noise force.

 Here is a rotation update for the model:

Finally, here is a one that becomes smaller when it is about to die according to the life cycle:

 right transmitter

The predicted launcher is basically the same as the one on the left, but there is one difference, that is the Visibility Tag.

Differences from the transmitter on the left

Visibility Tag在左边的发射器是一个生成时候的固定值,生成之后,该粒子的Visibility Tag就不会发生改变了。

而右边的发射器中,Visibility Tag是在粒子更新里面时时刻刻变化的。

可以看到里面,是将当前的生命周期【0-1】*4,然后将浮点转换为整数,这样做出0-3之间的变化,从而做到在运行时候模型发生变化。

3.4 Texture Sampling

 用的是GPU

 发射器更新

是无限循环,持续10秒。

 "Spawn Particles in Grid"是Niagara中一个模块,用于在网格中生成粒子。

这个模块可以将一组粒子按照网格的形式生成,以创建更规则和有序的粒子效果。

使用"Spawn Particles in Grid"模块时,你可以指定网格的大小、密度、起始位置和方向等参数。粒子会根据这些参数在指定的网格区域内以规则的方式进行生成。

这种生成方式可以用于制作特定的粒子效果.

这里我们的z轴方向为0【可以增大,看效果】

 

 粒子生成

上面是生成的位置。

下面这个是填充单元,比如xyz是1,1,1,那么我们改了x,y可以发现生成的粒子有了一个明显的拉伸效果。

这个是可以输入的纹理【可以换换玩一下】

然后下面的是uv,它是通过Normalized Array location【网格位置模组输出每个粒子在网格中的标准化位置,使用这数值来采样纹理就像它是UV坐标一样。】获取其中的x轴或者y轴做浮点数,然后这两个浮点数做一个向量2D,以此作为uv。

 

 SampledColor 是一个采样后的参数,就是获取采样的纹理中的颜色。

所以这里直接通过它来进行颜色的设置。

 这个模块是杀死粒子:

当A的颜色中的alpha通道【做浮点】和B【值是0】相等的时候,那么就杀死粒子。

粒子更新

通过生命周期的曲线来设置了涡的力度,在发生扩张和收缩的时候开始增强影响【特效中收起来有明显的褶皱的效果】。

 中间的吸引力:

 根据生命周期来设置颜色:

 最后是解算器和渲染器。

4.1Play Audio Per Particle

 打开后可以看到5个发射器,不过不需要着急,因为我们只需要分开来看就可以看懂。

 系统

首先在系统做了一个计算,计算方式看图:

 

 计算好之后,我们来看其他的发射器:

下面的两个都是接收到上面的发射器传输的事件之后才会执行的。

上面的三个便是最开始的3个发射器。 

首先我们来看第三个发射器,即旋转的模型【有声音】

第三个发射器

发射器更新 

它首先是做了一个发射器属性,类别是音频播放器。然后在发射器这里安装了这个要播放的音效。

这里的意思是值创建一次,并且是无限的,可以看到其Inactive Response的模式是Continue,这个的意思是继续(发射器停用,但在系统停用之前不会死亡)。

下面的部分,可以看到MaxDistance,意思是最大剔除距离。

简单解释就是相机的距离,在该距离之外,发射器被认为是被剔除的。

这允许发射器根据它们是否超出最大值来关闭或完成距离,例如,当与相机的距离增加时,禁用视觉上无关紧要的发射器

可以看到是生成了一个粒子。

 

粒子生成

 初始化的模型是蓝色【可以在这里去更改其他的颜色】,下面的则是模型的大小。

 网格体的生成方向

 粒子更新

可以看到这里没有打勾,意思就是不会杀死超过生命周期的粒子:

 以z轴为轴向旋转:

 这个Drag用的是Rotational DDrag,以我们在系统计算的SineWare为Alpha,来做2-5之间的阻力。

阻力是2的时候就是速度快的时候,阻力为5就是速度慢的情况。

这里重新计算出了相关的动能和势能。

这将在之后的播放里面用的就是相关的总能量来播放的。

 

这里选择播放,然后用的是之前发射器的属性:

Next, play the volume here, and you can see that the alpha value is Remapped Total Energy (remapped total energy)

That is, the relevant kinetic energy and potential energy calculations we performed above are related.

 The same goes for the color, the greater the energy, the brighter the color of the model.

 After that comes the mesh renderer.

second transmitter

 

launcher update

 This is a continuous launch, the maximum distance is 2000.

The number of spawns per second is 0.375.

 particle generation

Generate blue, life cycle is 1.6-2s

10 times the size.

Then the generated range is a circle with a radius of 8.

Then the speed is tapered, the strength is 475-700, and the angle is 48.

 

 

 particle update

Updating kills particles.

Gravity is -980 on the z axis.

The color will become transparent due to the life cycle [alpha channel]

The premature aging rate is around 1000.

 

 The sound is played after the collision, the sound size is random, and the position where the sound is played is the position of the particle.

Generate a death event.

 

 Another emitter after the death event spawns

The maximum distance is 2k.

After initialization, add speed between 25-100【Cone】

 The drag is 0.25, and the color is transparent through the life cycle [alpha channel]

The size also gradually decreases with the life cycle.

 Receive events to create particles:

first launcher 

The launcher is basically the same as before, the difference is:

Generate watch death events and play sound effects on death

 another launcher

Others are basically the same, the only difference is the change of parameters.

Particles are generated when receiving death events, and then inherit related properties.

 4.2 Renderers With No Particles

Renderer without particles:

 

The biggest difference here is that emitters are selected in the renderer, not particles:

 For others, just look at the modules:

 4.3 Mesh Orientation vs. Rotational Force

 

There are 3 emitters after opening, first we look from the first one on the left:

There is not much to explain simply.

launcher one

First of all, when the particles are generated, the direction of the model is random:

 Here you can see that the axis of its rotation is the model itself, and the speed and direction can be filled in by yourself.

It is worth noting that drag, which affects the speed of rotation to a certain extent, is 1.371139.

launcher two

Here is to calculate the size of the model, then what density material to use, and its proportion.

 Also the direction of the random model

 Give the model a force to rotate, and a resistance to rotate:

launcher three

The same is to calculate and initialize the direction:

 add rotational force

 Here is the rotational force added to the rotational velocity:

 Rotation resistance:

 Calculate the kinetic and potential energies by:

 Compute color from energy:

Guess you like

Origin blog.csdn.net/q244645787/article/details/132413724