UE5.1_Niagara基礎(chǔ)_官方內(nèi)容示例_1.5
1.5 Blend Attributes by Value【混合屬性數(shù)值】
Transient variables are local only to a given stack context (Particle Update, for example) and are recalculated from scratch every frame, they do not persisit their value from frame to frame. This makes them different from Particle. variables which are saved in the particle payload and persist from frame to frame, which comes at a memory and performance cost.
Here we make a transient variable representing the current distance from the emitter origin, and use that to drive a color and scale curve.
【臨時變量是僅在給定堆疊環(huán)境中(如粒子更新)的本地變量且每幀都重新計算,計算結(jié)果不會保留到下一幀。這使臨時變量與會被保存在粒子負(fù)載中的粒子變量不同,因為粒子變量會消耗內(nèi)存和性能。】
【在這里我們創(chuàng)建了表示當(dāng)前粒子與發(fā)射器原點的距離的臨時變量,并用它來改變顏色和大小曲線】
創(chuàng)建臨時變量方法:
1、在Parameters面板的Stage Transients【階段臨時變量】欄點擊“+”號直接創(chuàng)建,然后拖到堆疊中設(shè)置。
2、在Parameters面板創(chuàng)建普通變量,再右鍵選擇Change Namespace【改變命名空間】,選擇Transient。
Normalize Distance Range【標(biāo)準(zhǔn)化距離范圍】函數(shù)
Start Position【開始位置】
End Position【終點位置】
Distance【標(biāo)準(zhǔn)距離:標(biāo)準(zhǔn)化距離范圍=(丨開始位置-終點位置丨)/標(biāo)準(zhǔn)距離,(丨開始位置-終點位置丨)取值為(計算結(jié)果)和(標(biāo)準(zhǔn)距離)兩者中的最小值】
Invert Normalized Range【顛倒標(biāo)準(zhǔn)化范圍:為True時,標(biāo)準(zhǔn)化距離范圍=1-原標(biāo)準(zhǔn)化距離范圍】
(此專欄為視頻對應(yīng)的文本知識,詳細(xì)內(nèi)容講解請看對應(yīng)視頻,有疑問請到對應(yīng)視頻下方評論區(qū)尋找答案,無法找到答案時再在該評論區(qū)提出問題,勿在此專欄下方的評論區(qū)提出問題)