UE5.1_Niagara高級1.5_ Skeletal Mesh Reproduction
1.5 Skeletal Mesh Reproduction【骨骼網(wǎng)格體重建】
"Max Delta Time Per Tick" is set to 1/60 to avoid large tick updates due to hitches.
【每幀最大時間間隔設置為1/60以避免卡幀時出現(xiàn)很久才運行一次Tick(游戲降到60幀以下時,此粒子系統(tǒng)仍會按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.
【對施加影響的發(fā)射器里的每個粒子進行迭代。計算這些粒子和網(wǎng)格體重建粒子的距離。加權重于每個粒子的影響并標準化它們的速度】
We fade the influencers effect on the mesh particles over time using the fade over time function.
【我們使用隨時間消退模組淡出網(wǎng)格體粒子的影響效果】
We can find an up-to-date skeletal mesh position using the previously stored triangle coordinate. This becomes the new rest location.
【我們可以使用先前存儲的三角面的位置找到最新的骨骼網(wǎng)格體位置。這成為新的休息位置】
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通道使底材質(zhì)發(fā)光。在此示例我們重新映射輸入值來找到一個滿意的衰減曲線】
The solver limits the particle's velocity and acceleration to ensure that the chaotic forces don't generate unrealistic motion.
【結算器限制粒子速度和加速度來確?;煦缌Σ粫刹环犀F(xiàn)實的運動】
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.
【通過對模擬和休息狀態(tài)進行線性插值,我們能利用不同的力而不用擔心它們變得太大。粒子最終會回到它們的休息狀態(tài)】
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.
【運動模糊需要正確的速度向量。我們先前執(zhí)行的線性插值使模擬速度無效,所以我們重新計算它并發(fā)送給渲染器】
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發(fā)射器使用事件來實現(xiàn)相似的效果,但性能消耗要比GPU發(fā)射器高得多】
Initialize Mesh Reproduction Sprite【初始化網(wǎng)格體重建圖片】模組:可與Niagara_MeshReproductionSpriteUVs材質(zhì)節(jié)點配合使用,使重建圖片顯示原網(wǎng)格體位置對應的UV。
【模組首先會選擇骨骼網(wǎng)格體上一個隨機位置。然后使用選中的三角形,計算出合理的圖片大小,uv縮放,圖片對齊等等?!?/p>
【為了正確地使粒子對齊網(wǎng)格體表面,應該設置圖片渲染器的對齊模式和面向模式為自定義,自定義面向向量遮罩應該為1,1,1】
【如果網(wǎng)格體沒有動畫,可以勾選“Module.Overwrite Instrinsic Variables”的布爾值來設置所有粒子系統(tǒng)固有參數(shù)(位置,速度等)。如果骨骼網(wǎng)格體會動,應該在粒子更新階段添加更新網(wǎng)格體重建圖片模組且在此更新模組不應該勾選該布爾值】
【最后,在你的材質(zhì)中,使用“Niagara_MeshReproductionSpriteUVs”來采樣網(wǎng)格體UV】
【注:此模組假定骨骼網(wǎng)格體UV是正方形的,沒有在單一軸方向壓縮】
Mesh【網(wǎng)格體】:骨骼網(wǎng)格體
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節(jié)點:根據(jù)索引讀取屬性以獲得向量
Logic AND節(jié)點:都真時為真
Particle Attribute Reader→Get Num Particles節(jié)點:獲得讀取器中當前存在的粒子數(shù)
Map For節(jié)點:根據(jù)Iterations Count對上一個主線Map Set(沒有時為InputMap)到此Map For的運算進行循環(huán)迭代
Fade Over Time【隨時間消退】模組:當輸出值≤目標值時,輸出值=目標值;當輸出值>目標值時,輸出值減小。
Decay Rate Function【衰退速度方式】
Linear【線性】
Percentage【百分比】
Fade Rate【消退速度】
(僅Percentage)Minimum Step Size【最小步距】
Target Value【目標值】
Minimum Value【最小值】
Update Mesh Reproduction Sprite【更新網(wǎng)格體重建圖片】模組:
Mesh【網(wǎng)格體】
Overwrite Instrinsic Variables【重寫固有屬性】
Sprite Size【圖片大小】:輸入初始化網(wǎng)格體重建圖片模組算出的圖片大小致
Mesh Tri Coordinate【網(wǎng)格體三角面位置】:輸入初始化網(wǎng)格體重建圖片模組輸出的Mesh Tri Coordinate,使模組獲得網(wǎng)格體的同一個三角面的實時世界坐標位置Mesh Position
UV Width【紋理寬】
Lerp Particle Attributes【線性插值粒子屬性】模組:配合更新網(wǎng)格體重建圖片模組輸出的臨時變量使粒子回歸原位
Calculate Accurate Velocity【計算精確速度】模組:根據(jù)先前位置和當前位置計算速度,通常在結算器計算后又改變了粒子位置時使用