最美情侣中文字幕电影,在线麻豆精品传媒,在线网站高清黄,久久黄色视频

歡迎光臨散文網(wǎng) 會(huì)員登陸 & 注冊(cè)

UE5.1_Niagara高級(jí)1.2_ Advect Grid 2D Collection

2023-04-05 09:22 作者:Winter惜曦  | 我要投稿
  • 1.2 Advect Grid 2D Collection【平流輸送網(wǎng)格2D集合】

  • We first make ourselves a Texture Sample, a Render Target, and a Grid2d Collection. The Grid2D collection is an array of 2d buffers which can hold float attributes. Right now we don't worry about how many attributes the grid collection has, because we will add them automatically with a custom namespace below.

    (eventually we want 4 floats, which add up to an RGBA texture output)

    【我們首先設(shè)置了紋理采樣,渲染目標(biāo),和網(wǎng)格2D集合這三個(gè)變量。網(wǎng)格2D集合是一個(gè)用于存放浮點(diǎn)屬性的2D緩沖區(qū)數(shù)組。現(xiàn)在我們不用擔(dān)心網(wǎng)格集合里有多少屬性,因?yàn)槲覀儗⒂靡粋€(gè)自定義命名空間來自動(dòng)添加它們】

    【(最終我們想要4個(gè)浮點(diǎn)數(shù),用于RGBA紋理輸出)】

  • The performance of these grids is entirely constrained by their resolution, and the precision of the underlying data. Almost all grids can get away with being Half Float precision, and in this case since we are working with 0-1 texture channel data, we can choose Normalized Float for even greater savings. You almost never need full float precision on a grid.

    【這些網(wǎng)格性能完全受限于它們的分辨率,和下層數(shù)據(jù)的精度。幾乎所有網(wǎng)格都只需要半精度浮點(diǎn)數(shù),和在此示例因?yàn)槲覀兪鞘褂?到1的紋理通道數(shù)據(jù),所以我們?yōu)榱烁玫毓?jié)省性能消耗可以選擇標(biāo)準(zhǔn)化的浮點(diǎn)數(shù)。我們幾乎從不需要在網(wǎng)格上使用全精度浮點(diǎn)】

  • First we fill our grid collection with a texture. The iteration source on this Simulation Stage is our grid collection, i.e. we want to iterate over every grid cell and take some action. If we want this to only happen once on emitter spawn, we can check "Emitter Reset Only". Otherwise, we use a oscillating sine wave to fill the grid with the texture when the emitter loops. This way the advection evolves with the emitter, and when the emitter loops, it re-fills the grid and starts anew.

    【首先我們用紋理填充網(wǎng)格集合。這里的模擬階段的迭代源為網(wǎng)格集合。我們想要迭代在每個(gè)網(wǎng)格單元格并執(zhí)行某些行動(dòng)。如果我們只想在發(fā)射器生成時(shí)發(fā)生一次,我們可以勾選“Emitter Reset Only”。否則,當(dāng)發(fā)射器循環(huán)時(shí)我們使用一個(gè)振蕩的正弦波來用紋理填充網(wǎng)格。這時(shí)平流輸送與發(fā)射器共同演變,并當(dāng)發(fā)射器循環(huán)時(shí),它重新填充網(wǎng)格并重新開始】

  • Notice the use of a new namespace called StackContext. This namespace is adaptive to the stack it is used in. In Particle stages, it converts itself to the Particles.X namespace. When used in a Simulation Stage, it takes on the properties of whatever data interface is set as the iteration source. In this case, a Grid Collection. Writing to StackContext.RGBA automatically creates a named Vector4 attribute on the grid collection which can be read from or written to in subsequent stages, similar to a Particle Attribute in particle scripts.

  • 【留意使用的叫“StackContext”的新命名空間。這個(gè)命名空間適應(yīng)于使用它的堆疊。在粒子階段,它自身轉(zhuǎn)換為“Particles.X”命名空間。當(dāng)在模擬階段使用時(shí),它承擔(dān)迭代源設(shè)置的數(shù)據(jù)接口的屬性。在此示例,為網(wǎng)格集合。寫入為StackContext.RGBA時(shí)自動(dòng)在網(wǎng)格集合里創(chuàng)建名為Vector4屬性,這屬性可在隨后階段讀取或?qū)懭?,與粒子腳本中的粒子屬性相似】

  • Next, we advect our texture by stepping backwards along a curl noise vector, sampling the grid, and then writing that sampled position to the current grid cell. We use the curl noise data interface for simplicity, but this could easily be driven by a separate velocity grid (in the case of a fluid simulation), a sampled texture, or other means.

    【隨后,我們通過沿卷曲噪聲向量向后移動(dòng)來平流輸出紋理,采樣網(wǎng)格,然后在當(dāng)前網(wǎng)格單元格寫入采樣位置。為了簡(jiǎn)單我們使用卷曲噪聲數(shù)據(jù)接口,但這可容易地通過單獨(dú)的速度網(wǎng)格來驅(qū)動(dòng)(在流體模擬的情況),一個(gè)采樣的紋理,或其他方式】

  • Lastly, we have a stage with the iteration source set to our render target. We sample the grid cells via a UV, and write those directly to the render target which we send to the material using an entry in the "Material Parameter Bindings" array.

    【最后,我們有一個(gè)階段的迭代源設(shè)置為我們的渲染目標(biāo)。我們通過UV采樣網(wǎng)格單元格,并直接寫入到渲染目標(biāo),并將渲染目標(biāo)通過“Material Parameter Bindings”的入口發(fā)送到材質(zhì)里】

  • Grid2D Collection變量:網(wǎng)格2D集合接口

  • Cus_SampleTextureToGrid2DCollection模組

  • Cus_AdvectGrid2DCollection模組

  • Cus_SampleToRenderTarget2D模組


UE5.1_Niagara高級(jí)1.2_ Advect Grid 2D Collection的評(píng)論 (共 條)

分享到微博請(qǐng)遵守國(guó)家法律
滦南县| 册亨县| 天峨县| 肇州县| 潜江市| 增城市| 靖安县| 朝阳县| 盐山县| 莎车县| 新巴尔虎左旗| 石城县| 瓮安县| 周至县| 黎平县| 凤山县| 城市| 凤冈县| 遂川县| 保定市| 通许县| 霍林郭勒市| 女性| 齐河县| 海门市| 伽师县| 白山市| 施甸县| 逊克县| 桂东县| 镇坪县| 分宜县| 怀宁县| 兴和县| 永川市| 枣强县| 库尔勒市| 东台市| 天津市| 新乐市| 昌乐县|