欢迎光临散文网 会员登陆 & 注册

UE5.1_Niagara高级1.6_ Distance Field Traversal

2023-04-26 10:11 作者:Winter惜曦  | 我要投稿
  • 1. 6 Distance Field Traversal【遍历距离场】

  • Modeling life forms and accurate interactions with geometry can be done but it requires care. At each step along the way we apply constraints to ensure that the insects remain on the surface, do not clip with it, rotate, move and accelerate at appropriate rates for their size.

    The mental state of each insect can be mimicked by representing new behaviour patterns.

    External forces and avoidance modules can produce engaging results.

    Resolving all of your constraints may be involved but the outcome can be quite rewarding :)

    【建模生命形状和使用几何进行准确交互是可以实现的,但这过程需要谨慎地进行设计。这个过程中我们每一步施加的限制是为了确保昆虫停留在表面,避免夹在表面上,并以适合它们大小的速度来旋转,移动和加速】

    【通过表现新的行为模式来模仿每只昆虫的精神状态】

    【外力和躲避模组可以产生吸引人的效果】

    【结算所有的可能涉及的限制可产生非常好的输出结果】

  • The light cone transform and the spawn volume dimensions are externally controlled. A number of other important properties are consolidated here as user facing controls as well.

    【光锥转换和生成体积尺寸是由外部控制的。许多其他重要的属性也一样被整合到用户参数里】

  • Note: using static distance fields textures rather than the global distance can yield a far better results that are stable at any distance.

    【注:使用静态距离场纹理替代全局距离可在任何距离都稳定获得更好的结果】

  • Crawl tangentially to the distance field generates a final position and velocity for each particle. It samples the distance field several times and finds the optimal position for each particle based on its geometry.

    【沿距离场切线爬行给每个粒子生成一个最终位置和速度。多次采样距离场并基于粒子的几何尺寸给每个粒子找出最佳的位置】

  • Initial spawn count. The number of actual particles in the simulation will be less after we cull the majority of insects.

    【初始化生成数量。模拟时实际粒子数量会在我们剔除大多数昆虫后变少】

  • Each Particle will have a different top speed etc.

    【每个粒子会有不同的最高速度等】

  • Randomize the mesh scale and compensate for the models original size

    【随机化网格体比例并补偿模型原始尺寸】

  • Place particles in a box around in the level system. Move particles to nearest surface and kill them if they're too far away

    【在层级系统的盒子里放置粒子。移动粒子到最近表面,如果它们离得太远则清除它们】

  • Calculate the radius and each particle's movement characteristics based off of its size

    【基于粒子的大小计算每个粒子的半径和移动属性】

  • align the mesh to the SDF and randomize the z axis rotation.

    Derive the world space forward vector from a transformed mesh space vector. The insects are now randomly placed and oriented.

    【使网格体对齐有符号距离场并随机化Z轴旋转】

    【把网格体空间向前向量转换成世界空间向前向量。现在随机放置和定向昆虫】

  • The insect's pivot point and its center of mass are in two different locations. We define their relationship here.

    【昆虫的枢轴点和它的重心在不同的位置。我们在这里定义它们的关系】

  • Various forces are controlled via floats located in the Swarm Force Coordinator. We define how insects should behave when they're alarmed or calm. Additional behaviour patterns can easily be added. As soon as the insects mood shifts we start to lerp to a new set of values over time.

    【通过群力协调器模组的浮点数控制不同的力。我们定义昆虫在惊恐或镇静时应该如何行动。额外的行为模式可被容易地添加。一旦昆虫情绪转换,我们开始随时间线性插值到一个新的设置数值】

  • The distance traveled variable uses a namespace modifier so this precludes from using the previous modifier. To work around this we right the last frames calculated value to a new variable.

    【距离漫游变量使用一个命名空间修饰语而不使用先前的修饰语。为此我们将上一帧的计算值写进一个新的变量】

  • The insects are constantly moving. For that reason, we calculate an updated center of mass world position.

    【昆虫在不断地移动。因此,我们计算一个更新的重心所在的世界位置】

  • Flashlight/raytrace: We sphere cast/ray trace the distance field to find out if the insect is getting hit by the light or in the shadow. IF it's in the shadow then we mask the effect of the cone/flashlight. If not, a force is applied to the particles to push them out of the cone. We also FADE it's impact on the insects state over time which pushes the particles into an excited state and allows it to relax over time.

    【闪光灯/光线追踪:我们球形投射/光线追踪距离场来找出昆虫是被光照中还是在阴影中。如果在阴影中,我们遮罩光锥/闪光灯的效果。如果不在阴影中,则给粒子施加一个力来推动昆虫离开光锥。我们还随时间淡出昆虫的兴奋状态,并允许昆虫休息】

  • (Animate) Particles should move if they're avoiding the light or told to via the "time based state machine".

    【(动画)如果昆虫正在躲避光或被“时间状态机”通知要移动时,昆虫应该进行移动】

  • These forces always attempt to act on the insects. The solver later determines if they're applied or not.

    【这些力总是尝试对昆虫起作用。结算器最后决定是否应用它们】

  • Velocity and force are masked here when they're not needed.

    【当不需要速度和力时,遮罩它们】

  • Ignore new solve data if the insect should not animate.

    【如果昆虫不应该动,则忽视新的结算数据】

  • Interp over time prevents velocity from shifting too quickly

    【随时间插值,以阻止速度切换太快】

  • Interp normal over time increases stability. Flight Orientation orients the meshes to the underlying distance field and forces particles to bank on turns. It can also reduce turn rates. Internally, the module smooths out all of it's inputs and outputs over time.

    【随时间插值法线以增加稳定性。飞行朝向使网格体定位到下层距离场,并强迫粒子在转弯时倾斜。它还降低转换率。在内部,模组随时间平滑所有输入和输出】

  • Track distance traveled over time compares this frame's position vs the previous frames.

    This is used to drive the vertex shader animation which moves the insects legs.

    【通过对比当前帧位置和之前帧位置,来随时间追踪漫游距离】

    【这用于驱动移动昆虫腿的顶点渲染动画】

  • Collision Query变量类型:用于查询碰撞相关的数据接口,如几何追踪和深度缓冲,(包含全局距离场和场景深度场)

  • Find Nearest Distance Field Surface GPU【找到最近距离场表面GPU】节点

    当距离场分辨率较低时可连续多次查询,多次查询后的点不一定比第一次查询远,也可能更近。

    查询的是全局距离场,离摄像机越远,距离场分辨率越低

    (旧名字为Find Nearest Distance Field Iso Surface【找到最近距离场等位面】)

    New Position【新位置】:最近表面点的位置

    Vector to Nearest Surface【到最近表面向量】:单位向量,由采样点指向表面点

    Distance To Surface【到表面距离】:采样点到表面点的距离

  • Direction and Length Safe【方向和长度安全】节点:返回向量长度,并安全地标准化向量

  • Project Vector on Plane【投影向量到平面】节点:获得向量在平面上的投影

    Vector【向量】

    Normal【法线】:平面的法线

  • Multiple Vector with Quaternion【向量与四元数相乘】节点:即使用四元数旋转向量

  • FN First Frame Numeric【第一帧数值】节点:第一帧返回初始值,后续返回另一个值

  • Modulo【余数】节点:获得A/B的余数

  • Move to Nearest Distance Field Surface GPU【移动到最近距离场表面GPU】模组

    Write to Instrinsic Properties【写到固有属性】:把最近距离场表面位置写进粒子位置

    Active【激活】

    Kill by Distance【距离清除】:粒子到最近距离场表面位置(实际为DistanceTraveledToSurface)超过此距离时清除粒子

    Radius【半径】:使粒子从表面偏移(实际为沿三次采样的平均法线的反方向偏移)

    Output.MoveToNearestDistanceFieldSurfaceGPU.DistanceTraveledToSurface:为三次查询的移动距离之和

    Output.MoveToNearestDistanceFieldSurfaceGPU.VectorToNearestSurfaceNormal:单位向量,为外表面点时指向内部,为内表面点时指向外部

  • Time Based State Machine【基于时间的状态机】模组

    注:输出一个浮点数OnOffPercentage来指示粒子处于状态on(1),状态off(0),还是on到off的过渡状态

    Lerp Time To Off【插值时间到Off】:从1减少到0所花的时间

    Lerp Time To On【插值时间到On】:从0增加到1所花的时间

    Off Duration【Off状态持续时间】:减去Lerp Time To On 后为OnOffPercentage=0时的持续事件

    On Duration【On状态持续时间】:减去Lerp Time To Off 后为OnOffPercentage=1时的持续事件

    Invert On Off Percentage【颠倒OnOffPercentage的值】

    Initial Start Time【初始开始时间】:从On状态开始计时,初始的开始时间

    Output.TimeBasedStateMachine.OnOffPercentage

  • Ray Trace Distance Field GPU【光线追踪距离场GPU】模组

    需要取消勾选Library Only,沿光线迭代采样全局距离场来找出最近表面点

    Ray Origin【光线原点】:投射光线的起始点

    Ray Vector【光线向量】:即光线追踪的方向

    Max Trace Length【最大追踪距离】

    Minimum Step Size【最小步距】

    NumberOfIterations【迭代次数】:最小值为1,迭代次数越高,追踪距离越远

    TraceWidth【追踪宽度】:球形追踪半径(追踪半径逐渐减小?新一次迭代时追踪半径重新开始?)

    Output.RayTraceDistanceFieldGpu.Intersects【交接】:从光源向粒子投射光线追踪,限制追踪距离为光源到粒子的距离,Intersects为True则粒子在阴影,为False则不在阴影

  • Avoid Cone【躲避圆锥】模组

    需要取消勾选Library Only,用于使粒子转向躲避聚光灯或其他圆锥。包含的限制帮助避免进入附近表面。

    Active【激活】

    Strength【强度】:生成力的最大值

    Write To Physics Force【写入物理力】

    Apply Constraints【应用限制】:为True时,生成的力将被限制指向附近表面

    (仅是Apply Constraints)Automatically Find Nearest Surface【自动找到最近表面】

    Constraint Influence【限制影响】:调节平面限制的影响

    Use Distance Based Plane Adherence【使用距离平面粘合】:只对靠近表面的粒子施加应用表面限制

    Apply Radial Falloff【应用半径衰减】:给结果力应用从圆锥顶点开始的线性衰减

    Cone APEX【圆锥顶点】

    Cone Axis【圆锥轴】

    Cone Coodinate Space【圆锥坐标空间】:包括圆锥顶点和圆锥轴

    Falloff Angle Inner【衰减内锥角】

    Falloff Angle Outer【衰减外锥角】

    Falloff Radius【衰减半径】:最大影响距离

    Write Out Debug Parameter【写出调试参数】:要设置自定义面向和对齐

  • Interpolate Over Time【随时间插入】模组

    随时间对目标值进行线性插值,使移动平均值趋向于目标值

    Variable Type【变量类型】

    Target Value【目标值】

    Initial Value【初始值】:为True时,移动平均值的初始值等于此初始值,为False时,移动平均值的初始值为目标值

    Rate Of Change【改变速率】:当前值插值到目标值的速度

    Stackcontext.InterpolateOverTime.InterpolateOverTimeV3.MovingAverage:移动平均值


UE5.1_Niagara高级1.6_ Distance Field Traversal的评论 (共 条)

分享到微博请遵守国家法律