UE5.1_Niagara高级1.5_ Skeletal Mesh Reproduction
1.5 Skeletal Mesh Reproduction【骨骼网格体重建】
"Max Delta Time Per Tick" is set to 1/60 to avoid large tick updates due to hitches.
【每帧最大时间间隔设置为1/60以避免卡帧时出现很久才运行一次Tick(游戏降到60帧以下时,此粒子系统仍会按60帧来进行模拟)】
We find a permanent triangle coordinate for each particle. This is referenced later on to find particles' rest positions.
【我们给每个粒子找一个固定的三角面的位置。这用于后面找到粒子的休息位置】
Zero out the variables that will be used throughout the simulation.
【使将在模拟时使用的变量归零】
Iterate over each particle in the influencer emitter. Calculate the distance between those particles and the mesh reproduction particles. Weight each particles influence and normalize their velocity.
【对施加影响的发射器里的每个粒子进行迭代。计算这些粒子和网格体重建粒子的距离。加权重于每个粒子的影响并标准化它们的速度】
We fade the influencers effect on the mesh particles over time using the fade over time function.
【我们使用随时间消退模组淡出网格体粒子的影响效果】
We can find an up-to-date skeletal mesh position using the previously stored triangle coordinate. This becomes the new rest location.
【我们可以使用先前存储的三角面的位置找到最新的骨骼网格体位置。这成为新的休息位置】
The material bases it's glow off of the particle color's alpha channel. In this case we remap the incoming values to find a pleasing falloff curve.
【使用粒子颜色的alpha通道使底材质发光。在此示例我们重新映射输入值来找到一个满意的衰减曲线】
The solver limits the particle's velocity and acceleration to ensure that the chaotic forces don't generate unrealistic motion.
【结算器限制粒子速度和加速度来确保混沌力不会生成不符合现实的运动】
By lerping between the simulation and the rest state we can utilize various forces without worrying about them becoming too intense. The particles will return to their rest states eventually.
【通过对模拟和休息状态进行线性插值,我们能利用不同的力而不用担心它们变得太大。粒子最终会回到它们的休息状态】
Motion blur requires proper velocity vectors. The lerp that we previously performed invalidated the simulations velocity so we recalculate it and send it to the renderer.
【运动模糊需要正确的速度向量。我们先前执行的线性插值使模拟速度无效,所以我们重新计算它并发送给渲染器】
The newly calculated render velocity is fed to the sprite renderer.
【重新计算的RenderVelocity绑定到图片渲染器的速度绑定中】
These cpu emitter uses events to achieve a similar effect but at a much higher cost.
【这些cpu发射器使用事件来实现相似的效果,但性能消耗要比GPU发射器高得多】
Initialize Mesh Reproduction Sprite【初始化网格体重建图片】模组:可与Niagara_MeshReproductionSpriteUVs材质节点配合使用,使重建图片显示原网格体位置对应的UV。
【模组首先会选择骨骼网格体上一个随机位置。然后使用选中的三角形,计算出合理的图片大小,uv缩放,图片对齐等等。】
【为了正确地使粒子对齐网格体表面,应该设置图片渲染器的对齐模式和面向模式为自定义,自定义面向向量遮罩应该为1,1,1】
【如果网格体没有动画,可以勾选“Module.Overwrite Instrinsic Variables”的布尔值来设置所有粒子系统固有参数(位置,速度等)。如果骨骼网格体会动,应该在粒子更新阶段添加更新网格体重建图片模组且在此更新模组不应该勾选该布尔值】
【最后,在你的材质中,使用“Niagara_MeshReproductionSpriteUVs”来采样网格体UV】
【注:此模组假定骨骼网格体UV是正方形的,没有在单一轴方向压缩】
Mesh【网格体】:骨骼网格体
Overwrite Instrinsic Variables【重写固有变量】:为True时,模组将重写粒子位置、图片面向等,而不是仅输出模组位置
Particle Scale【粒子比例】
Max Particle Size【最大粒子尺寸】:超出此设置的粒子将被裁剪到此尺寸
Kill Particles Below X Width【清除宽度小于X的粒子】:设置允许的粒子的最小宽度,小于此值的粒子将被清除。
Cus_Iterate Over Influencers Inline模组:遍历每个施加影响的粒子,获得合影响速度和平均的标准化的总影响力
Particle Attribute Reader→Get Vector by Index节点:根据索引读取属性以获得向量
Logic AND节点:都真时为真
Particle Attribute Reader→Get Num Particles节点:获得读取器中当前存在的粒子数
Map For节点:根据Iterations Count对上一个主线Map Set(没有时为InputMap)到此Map For的运算进行循环迭代
Fade Over Time【随时间消退】模组:当输出值≤目标值时,输出值=目标值;当输出值>目标值时,输出值减小。
Decay Rate Function【衰退速度方式】
Linear【线性】
Percentage【百分比】
Fade Rate【消退速度】
(仅Percentage)Minimum Step Size【最小步距】
Target Value【目标值】
Minimum Value【最小值】
Update Mesh Reproduction Sprite【更新网格体重建图片】模组:
Mesh【网格体】
Overwrite Instrinsic Variables【重写固有属性】
Sprite Size【图片大小】:输入初始化网格体重建图片模组算出的图片大小致
Mesh Tri Coordinate【网格体三角面位置】:输入初始化网格体重建图片模组输出的Mesh Tri Coordinate,使模组获得网格体的同一个三角面的实时世界坐标位置Mesh Position
UV Width【纹理宽】
Lerp Particle Attributes【线性插值粒子属性】模组:配合更新网格体重建图片模组输出的临时变量使粒子回归原位
Calculate Accurate Velocity【计算精确速度】模组:根据先前位置和当前位置计算速度,通常在结算器计算后又改变了粒子位置时使用

