UE5.1_Niagara高級2.1_ Particle Attribute Reader
2.1 Particle Attribute Reader【粒子屬性讀取器】
This emitter spawns a single particle with a random color.
【此發(fā)射器生成一個隨機顏色的粒子】
The Attribute Reader is defined at Emitter Spawn so multiple modules can reference it.
The emitter to be read is specified here.
【屬性讀取器在發(fā)射器生成階段被定義,所以多個模組能夠引用它】
【發(fā)射器只能在此處被讀取】
The Attribute Reader is used inside the 'Read Color from Emitter' scratch module to query the color of the Source particle. Double click the module to view.
【屬性讀取器被使用在Read Color from Emitter本地模組里,用于查詢源粒子的顏色。雙擊模組進行查看】
There are two options when identifying a particle to read: Index and ID.
Index is the Index of the particle in the other emitter from 0 to NumParticles-1. As particles die, their index can change so it's inherently unstable, but straightforward to use in simple cases like this one.
【當識別需要讀取的粒子時,即可使用Index來識別,也可以使用ID來識別】
【Index是讀取的發(fā)射器的粒子索引,從0開始到粒子數(shù)量減1結(jié)束。當粒子死亡時,它們的索引就會改變,所以它們是不固定的,但可以在現(xiàn)在這種簡單情況下使用】
ID remains table over time and is unique across all emitters in a system, but it can be hard to identify across emitters.
In this case we know we are querying an emitter with only one particle. As a result we can hard-code the index to zero.
【ID隨時間保持穩(wěn)定,且在系統(tǒng)中所有發(fā)射器里都是唯一的,但它很難跨發(fā)射器識別。在此案例我們知道我們查詢的發(fā)射器只有一個粒子。所以我們直接設(shè)置索引的固定值為0】
This can be used to sample a particle by Index, but then cache off its ID for later stable sampling.
【這可用于使用索引采樣粒子ID,然后使用該ID固定采樣該粒子】
This emitter rotates a single particle around the Y axis. It's color is picked randomly each loop.
【此發(fā)射器繞Y軸旋轉(zhuǎn)一個單一粒子。它在每次循環(huán)時隨機一種顏色】
This emitter creates a ring of particles around the Y axis.
The particles live forever and change color based on the proximity of the Leader particle.
【此發(fā)射器繞Y軸生成圓環(huán)排列的粒子】
【粒子永久存活并基于與領(lǐng)導(dǎo)粒子的靠近距離改變顏色】
Shape Location【形狀位置】模組用于粒子更新階段,實現(xiàn)粒子繞圈移動的效果
Return Normalized Exec Index【返回標準化執(zhí)行索引】函數(shù)