Visual Effect Graph——標準屬性引用

標準屬性

以下是所有常用屬性的綜合列表,並有簡要的描述和用法。

基礎的模擬屬性

模擬屬性是初始化和更新環境將處理的屬性,以便將行爲應用於模擬元素,如粒子或粒子軌跡。

Name Type Description Default Value
position Vector3

The position of a simulated element, expressed in the corresponding System Space, in System Units

模擬元素在相應的系統空間中以系統單位表示的位置

(0,0,0)
velocity Vector3

The current self-velocity of the simulated element, expressed as a 3D Vector in the corresponding System Space, in System Units per Second.

模擬元素的當前自速度,在相應的系統空間中以三維向量的形式表示,單位爲系統每秒。

(0,0,0)
age float

The age of the simulated element, since its spawn, expressed in Seconds.

模擬元素的年齡(自其衍生以來)以秒爲單位表示。

0.0
lifetime float

The life expectancy of a simulated element, expressed in Seconds.

模擬元素的預期壽命,用秒錶示。

0.0
alive bool

Whether the simulated element is alive or not.

模擬的元素是否存在。

true
size float

The size of a simulated element, in system Units.

以系統單位表示的模擬元素的大小。

0.1

高級模擬屬性

有些屬性更高級一些,將在大多數模擬中默認使用。但是,您可以更改這些屬性來增強您的行爲

Name Type Description Default Value
mass float

The mass of a particle in Kg/dm^3

一個粒子的質量,單位是Kg/dm^3

1.0 (defaults to 1kg per liter of water)
angle Vector3

Variadic: Euler rotation of a simulated element, expressed as a Vector of Degrees Values.

可變參數:模擬元素的歐拉旋轉,表示爲度值向量。

(0,0,0)
angularVelocity Vector3

Variadic: Euler rotation speed of a simulated element, expressed as a Vector of Degrees per second values.

可變參數:模擬元素的歐拉旋轉速度,表示爲每秒度數的矢量。

(0,0,0)
oldPosition Vector3

Deprecated: This attribute is a storage Helper if you want to back-up current position of a simulated element, before integrating its velocity.

Deprecated:如果希望在對模擬元素的速度進行積分之前備份其當前位置,則此屬性是一個存儲助手。

(0,0,0)
targetPosition Vector3

This attribute has various purposes: it can be a storage Helper if you want to store a position to reach, then compute a vector in order to reach this Target Position. In Line Renderers, this attribute can be also used to set the end of each line particle.

這個屬性有多種用途:如果您想存儲要到達的位置,那麼它可以是一個存儲助手,然後計算一個向量來達到這個目標位置。在行渲染器中,這個屬性也可以用來設置每個行粒子的結束。

(0,0,0)

渲染屬性

渲染屬性並不主要用於模擬,而是在渲染模擬元素時非常有用。

Name Type Description Default Value
color Vector3

The R,G, and B Components of the Rendered Element.

渲染元素的R、G和B顏色參數。

1,1,1
alpha float

The alpha Component of the Rendered Element

渲染元素的alpha參數

1
size float

The uniform size of a rendered element, in system Units, applied to its unit representation

以系統單位表示的已渲染元素的統一大小,應用於其單元表示

0.1
scale Vector3

The Non-uniform Scale multiplier of a rendered element, applied to its unit representation

渲染元素的非均勻比例乘法器,應用於其單位表示

(1,1,1)
pivot Vector3

The Origin position of a rendered element, in its unit representation

已渲染元素在其單元表示中的原始位置

(0,0,0)
texIndex float

The animation frame used for sampling Flipbook UVs for a rendered element.

用於對渲染元素的Flipbook uv進行採樣的動畫幀。

0.0
axisX Vector3

The computed Right axis of the rendered Element.

渲染元素的計算右軸。

(1,0,0)
axisY Vector3

The computed Up axis of the rendered Element.

渲染元素的計算上軸。

(0,1,0)
axisZ Vector3

The computed Forward axis of the rendered Element.

渲染元素的計算前向軸。

(0,0,1)

系統屬性

爲了獲得關於系統值的信息,還可以使用其他一些屬性。這些屬性是隻讀的(您只能使用Get <Attribute>操作符來讀取它們)。

Name Type Description Default Value
particleID uint

A unique ID that refers to 1 particle

一個唯一的ID指定一個粒子

0
seed uint

A unique seed used for random number computations.

一種用於隨機數計算的唯一種子。

0
spawnCount uint

A SpawnEvent attribute available as Source Attribute in Spawn Contexts, that describes how many particles were spawned this frame.

在生成環境中作爲源屬性可用的SpawnEvent屬性,它描述了有多少粒子在這個幀中被生成。

(0,0,0)
spawnTime float

A SpawnEvent attribute available as Source Attribute in Spawn Contexts, that contains a Spawn Context internal time (when exported using a Set Spawn TimeSpawn Block)

在生成環境中作爲源屬性可用的SpawnEvent屬性,該屬性包含生成環境內部時間(使用Spawn TimeSpawn塊導出時)

0.0
particleIndexInStrip uint

The index in the Particle Strip Ring Buffer where is located this element.

粒子帶環緩衝區中的索引,它位於該元素所在的位置。

0

屬性使用和隱式行爲

在模擬和渲染過程中,一些屬性組合被用於各種隱式情況。下面是一個用法列表,並解釋了它們之間的關係。

(Velocity and Position)速度和位置:集成


在更新模擬期間:任何使用velocity屬性的系統都會將速度與位置,在每一幀進行集成。

速度集成基本使用以下公式:position += velocity * deltaTime

通過選擇更新環境,然後將Integration enum設置爲None,可以禁用自動速度集成。

Age, Lifetime and Alive


在初始化環境中設置粒子的生存期屬性,將隱式地將下列行爲添加到更新環境中:

  • 粒子會使用公式age += deltaTime
  • 粒子會被回收使用公式:alive = (age < lifeTime)

通過選擇更新環境,然後將Age particle值設置爲False,可以禁用自動粒子老化。

通過選擇更新環境,然後將收割粒子值設置爲False,可以禁用自動粒子回收。

不朽粒子:沒有壽命的粒子被認爲是不朽的。您仍然可以通過將它們的alive屬性設置爲false來顯式地殺死它們。

角和角速度:角集成


在更新模擬期間:任何使用角速度(angularVelocity )屬性的系統都會將角速度與每一幀的角度進行集成。

角速度集成基本採用如下公式:angle += angularVelocity * deltaTime

通過選擇更新環境,然後將Angular Integration Enum設置爲None,可以禁用自動速度集成。

AxisX, AxisY and AxisZ


這三個屬性定義了單元表示的三維座標系統。雖然這些軸應該是標準化的,但是您可以在這三個軸之間使用非標準化長度和非正交角。

大多數情況下,這些軸是使用Orient塊(僅輸出環境)設置的。

大小、比例和軸心


爲了對模擬元素進行縮放和旋轉,視覺效果圖使用了3個屬性:

  • size 大小(float):粒子的均勻大小。
  • scale 比例(Vector3):粒子的每軸大小。
  • pivot  軸心(Vector3):在單位表示中的軸心位置。

一個粒子的軸心是在大小爲1的單元框中計算的:單元表示。默認情況下,它是(0,0,0),框的中心。您可以更改其值以調整框的中心。每個面都位於-0.5或每個軸上的0.5。

軸表示也可以在3D中推廣,用Z軸表示深度。

使用z分量的四邊形粒子使用Camera Facing將把元素朝向相機的位置或平面,或推動它遠離,使它出現更多的在實際位置的前面或後面。

一個粒子的縮放應用兩個乘子的單位表示框:

  • 統一的大小size
  • 非均勻尺度scale

您可以使用這兩個屬性中的任何一個來獨立地執行均勻縮放和非均勻縮放:例如,使用scale來計算初始隨機縮放,使用size屬性來動畫每個元素,保持其比例。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章