Attention: Here be dragons
This is the latest
(unstable) version of this documentation, which may document features
not available in or compatible with released stable versions of Godot.
Checking the stable version of the documentation...
3D 粒子尾迹¶
Setting up particle trails¶
Godot provides several types of trails you can add to a particle system. Before you can
work with trails, you need to set up a couple of parameters first. Create a new particle
system and assign a process material as described before.
In the Trails group of the particle system, check the box next to Enabled and
increase the emission duration by setting Lifetime to something like 0.8. On
the process material, set Direction to (X=0,Y=1.0,Z=0) and Initial Velocity to
10.0 for both Min and Max.
The only thing that's still missing is a mesh for the draw pass. The type of mesh that you set here controls what kind of particle trail you will end up with.
Ribbon trails¶
Important ribbon mesh parameters¶
The simplest type of particle trail is the ribbon trail. Navigate to the Draw Passes
section and select New RibbonTrailMesh from the options for Pass 1. A
RibbonTrailMesh is a simple quad that is divided into
sections and then stretched and repeated along those sections.
Assign a new Standard Material to the Material
property and enable Use Particle Trails in the Transform property group. The
particles should now be emitting in trails.
You have two options for the ribbon mesh Shape parameter. Cross creates two
perpendicular quads, making the particle trail a little more three-dimensional. This
really only makes sense if you don't draw the trails in Particle Billboard mode
and helps when looking at the particles from different angles. The Flat option
limits the mesh to a single quad and works best with billboard particles.
The Size parameter controls the trail's width. Use it to make trails wider or
more narrow.
Sections, Section Length and Section Segments all work together to
control how smooth the particle trail looks. When a particle trail does not travel
in a straight line, the more sections it has the smoother it looks as it bends and swirls.
Section Length controls the length of each section. Multiply this value by
the number of sections to know the trail's total length.
3 sections, 1m section length (left) vs. 12 sections, 0.25m section length (right). Notice how the total length of the trails stays the same.¶
Section Segments 参数进一步将每个部分细分为段。不过,它对尾迹部分的平滑度没有影响。相反,它控制粒子尾迹整体形状的平滑度。 Curve 属性定义此形状。点击“曲线”旁边的框,然后指定或创建新曲线。尾迹的形状将与曲线一样,曲线的值在尾迹的头部为 1.0 ,曲线的值在尾部为 1.0 。
由不同曲线形成的粒子尾迹。尾迹从左向右移动。¶
根据曲线的复杂程度,当部分数较少时,粒子尾迹的形状看起来不会非常平滑。这就是 Section Segments 属性的用武之地。增加节段的数量会在尾迹的两侧添加更多折点,以便它可以更紧密地跟随曲线。
颗粒尾迹形状平滑度:每节 1 段(顶部),每节 12 段(底部)¶
管状尾迹¶
管状尾迹与带状尾迹共享许多属性。它们之间的最大区别在于管状轨迹发出圆柱形网格而不是四边形。
管状尾迹发出圆柱形粒子¶
要创建管状尾迹,请导航到 Draw Passes 部分,然后从 Pass 1 选项中选择 New TubeTrailMesh 。一个 TubeTrailMesh<class_TubeTrailMesh>`是一个圆柱体,它被分成几个部分,然后沿着这些部分拉伸和重复。为 ``Material` 属性分配一个新的 Standard Material,并在 Transform 属性分组中启用 Use Particle Trails 。粒子现在应该以长圆柱形轨迹发射。
关键管状网格参数¶
Radius 和 Radial Steps 属性之于管状尾迹,就像 Size 之于带状尾迹一样。 Radius 定义管的半径,并增加或减少其整体尺寸。 Radial Steps 控制管圆周周围的边数。较高的值会提高管盖部的分辨率。
Sections 和 Section Length 对于管状尾迹和带状尾迹的工作方式相同。它们控制管道轨迹在弯曲和扭曲而不是沿直线移动时看起来有多平滑。增加节的数量将使其看起来更平滑。更改 Section Length 属性可更改每个节的长度以及轨迹的总长度。 Section Rings 是带状尾迹的 Section Segments 属性的管状尾迹等效项。它细分了小节,并为管添加了更多的几何形状,以更好地适应 Curve 属性中定义的自定义形状。
你可以用曲线塑造管状尾迹,就像塑造带状尾迹一样。点击 Curve 属性旁边的框,然后指定或创建新曲线。尾迹的形状与曲线相似,曲线的值在尾迹的头部为 0.0 ,曲线的值在尾迹尾部为 1.0 。
Particle tube trails with a custom curve shape: 4 radial steps, 3 sections, 1 section ring (left), 12 radial steps, 9 sections, 3 section rings (right)¶
你可能想要设置的一个重要属性是粒子系统的 Drawing 分组中的 Transform Align 。如果保持原样,管子将无法保持体积;它们在移动时变平,因为即使它们改变方向,它们的 Y 轴也会一直指向上方。这可能会导致大量渲染伪影。将属性设置为 Y to Velocity ,每个粒子尾迹都沿其运动方向保持其 Y 轴对齐。
未对齐的粒子管状尾迹(左)和 Y 轴与速度对齐的(右)¶