UE5.1_Niagara基礎(chǔ)_官方內(nèi)容示例_3.4
3.4 Texture Sampling【紋理采樣】
Texture sampling is only supported on the GPU at the moment.
【紋理采樣目前僅支持GPU粒子運行】
The Grid Location outputs a normalized location of each particle in the grid. We use that value to sample the texture as if it were a UV.
【網(wǎng)格位置模組輸出每個粒子在網(wǎng)格中的標(biāo)準(zhǔn)化位置(Output.GridLocation.Normalized Array location)。我們使用這數(shù)值來采樣紋理就像它是UV坐標(biāo)一樣】
The Kill Particles module acts as a form of "Rejection Sampling". We sample the texture and then kill the newly spawned particles on their first frame if the sampled texture alpha equals 0.
Because Interpolated Spawn is unchecked in the emitter properties, newly spawned particles do not run both their spawn and update scripts on the frame they were born, making this technique quite inexpensive.
【清除粒子模組用于“拒絕采樣”。我們對紋理進(jìn)行采樣然后在生成粒子的第一幀中清除Alpha=0的粒子】
【因為發(fā)射器屬性的“Interpolated Spawn插值生成”沒勾選,所以新生成的粒子在生成那一幀不會都運行粒子生成和粒子更新腳本兩個腳本,使得此技術(shù)性能消耗較少】
Spawn Particles in Grid【在網(wǎng)格中生成粒子】模組:基于設(shè)定的網(wǎng)格分辨率設(shè)置生成粒子
X Count【X軸總數(shù)】
Y Count【Y軸總數(shù)】
Z Count【Z軸總數(shù)】
Spawn Time【生成時間】
Grid Location【網(wǎng)格位置】模組
Grid Origin【網(wǎng)格原點】:即網(wǎng)格中心點位置
Coordinate Space【坐標(biāo)空間】
Normalize Offsets【標(biāo)準(zhǔn)化偏移】:啟用后,1代表1個網(wǎng)格單元格長度
Randomize Placement Within Cell【單元格內(nèi)隨機(jī)放置】:設(shè)置在X/Y/Z軸上隨機(jī)偏移的最大值
Dimension Difinition【尺寸定義】
Padding Per Cell【按單元格填充】:設(shè)置相鄰粒子的間距
Bounding Box Size【邊界框大小】:設(shè)置網(wǎng)格大小
(僅Bounding Box Size)Align To Grid Cell【對齊到網(wǎng)格單元格】
XYZ Dimension【XYZ的尺寸】
Sample Texture【采樣紋理】模組:采樣后獲得Output.SampleTexture.SampledColor參數(shù)
Texture【紋理】
Texture User Parameter【紋理用戶參數(shù)】:使用用戶參數(shù)設(shè)置的紋理
UV【紋理坐標(biāo)】:設(shè)置采樣的坐標(biāo)點
Kill Particles【清除粒子】模組
Kill Particles【清除粒子】:為True時清除粒子