UE5.1_Niagara高级3.8_ Structural Support
3.8 Structural Support【结构性支撑】
This emitter shows how one can produce multistaged emitters.
Splitting an effect up into multiple stages allows one to isolate blocks of complex functionality to the areas where they are needed.
In this case, we place particles and seperate them from each other's volumes. We then create a support structure and pass that off to a third and final runtime emitter. It benefits from all of the preprocessed tasks that were run before it without accumulating their complexity.
【此发射器展示如果制作多阶段发射器】
【将一个效果拆分成多个阶段可将复杂的功能块隔离到需要它们的区域】
【在此示例,我们放置粒子并将它们从彼此的体积中分离出来。然后我们创建一个支撑结构,并传给最后运行的发射器。这有利于让它跳过之前已运行的预处理任务,而不用积累它们的复杂性】
Stage 1: Place particles【阶段1:放置粒子】
We would normally kill these particles after a few frames of initialization took place and the particles were duplicated in another emitter. In this case, we retain them for visualization purposes.
【我们通常会在初始化发生过后再过几帧就清除粒子,这些粒子会被复制到另一个发射器。在此示例,我们为了可视化目的而保留它们】
The global distance field only extends 3500 units outward in the advanced Niagara map so we cull particles that reference it beyond that point.
【在高级Niagara地图中全局距离场仅向外延伸3500个单位,所以我们剔除超过该距离还引用距离场的粒子】
Init the PBD grid【初始化PBD网格】
Use this as an opportunity to perform as much complex position work that one might want.
【使用这作为一个时机来执行获得想要的更复杂的位置】
For visualization purposes, we dupe off and offset Particles.Position to a position variable that will be read by the renderer. This is done to make it visually distinct from the other emitters.
【为了可视化目的,我们复制并偏移粒子位置到一个渲染器读取的位置变量。这样做是为了清楚地从其他发射器外看见粒子】
Ensure that the particles don't clip through each other by running a Position Based Dynamics simulation.
【使用基于位置的物理模拟来确保粒子不会相互重叠】
Stage 2: Create a Heirarchy【阶段2:创建层级结构】
Wait a few frames and transfer the particles over to this emitter
【等几帧后转换粒子到此发射器】
Generate attribute readers for this emitter and the previous
【生成读取前发射器和此发射器的属性读取器】
Spawn the same number of particles as the previous emitter
【生成与前发射器数量相同的粒子】
Copy and apply key information from the previous emitter (position, etc.)
【复制和应用前发射器的关键信息,如粒子位置】
Dupe and offset the render location variable to differential it from the other emitters
【复制和偏移渲染位置变量到不同的发射器位置】
Sort and rank neighboring particles based 3 factors.
- How close are they?
- Does the direction from this particle to the other particle line up with the desired direction vector?
- Are the parent-child references non-circular? (Two particles shouldn't point toward each other)
We return 3 particle ids ranked from the best option to the worst. Id 1 being the best.
We then select one of those 3 options and define a "parent id".
【基于3个因素给相邻粒子排序和分等级】
【它们有多近?】
【是否在搜索向量附近?】
【父级-子级引用是非循环的?(两个粒子不应该相互指向对方)】
【我们返回3个由好到差排序的粒子ID。ID1是最好的】
【然后我们选择其中一个并把它定义为父级ID】
Stage 3:Animate the Particles【阶段3:使粒子运动】
Create a larger neighbor grid for this emitter because the particles will travel for longer distances.
【给此发射器创建一个更大的相邻网格,因为粒子会漫游更远距离】
In this example, we perform a number of ops that allow us to find correlations between this emitters particles and the previous emitter's particles. This allows us to recreate the bonds that were formed in the previous emitter.
【在此示例,我们执行一些操作,它允许我们找到前发射器粒子与此发射器粒子的关联。这允许我们重新建立前发射器的联系】
This module randomly activates a do once which then gets used to detach partcles from their constraints.
【此模组随机激活一个执行一次,这随后用于分离粒子的限制】
Collide particles against each other
【粒子相互碰撞】
Collide particles against the world
【粒子与场景碰撞】
Propagate detatchment: Each particle reads it's parent's particle supported parameter. If it is false, then this particle also unsupported.
【传播分离:每个粒子读取它们的父级粒子的支撑参数。如果为False,此粒子也不支撑】
"Freeze" supported particles by ignoring their forces, velocity and position updates. Lerp to the actively simulated positions when they are no longer supported.
【通过无视支撑粒子的受力,速度和位置更新来冻结它们。当它们不再支撑时线性插值到激活模拟位置】
Each particle becomes its own parent once it's no longer supported. This is done to avoid drawing lines between detached particles. Note that this occurs in the Set Particles.ParentID module.
【一旦粒子不再支撑,每个粒子变成它们自己父级。这样做是为了避免分离粒子间画线。注意此发生在设置粒子父级ID模组】
Do Once【执行一次】模组
Execute【执行】为True持续一帧,然后一直为False,直到开启Reset
Trigger Condition【触发器状态】:为True时才能使Execute为True
Reset【重置】