VoxelGIData

繼承: Resource < RefCounted < Object

包含用於 VoxelGI 節點的烘焙體素全域光照資料。

說明

VoxelGIData 包含烘焙的體素全域照明,用於 VoxelGI 節點。VoxelGIData 還提供了若干用來調整全域照明最終外觀的屬性。這些屬性可以在運作時調整,無須再次烘焙 VoxelGI 節點。

注意:為了防止基於文字的場景檔(.tscn)過度增長,導致加載和保存速度變慢,請始終將 VoxelGIData 保存為外部二進位資源檔(.res),不要將其嵌入到場景中。做法是點擊 VoxelGIData 資源旁邊的下拉箭頭,選擇編輯,點擊屬性檢視器頂部的軟碟圖示,然後選擇另存為...

教學

屬性

float

bias

1.5

float

dynamic_range

2.0

float

energy

1.0

bool

interior

false

float

normal_bias

0.0

float

propagation

0.5

bool

use_two_bounces

true

方法

void

allocate(to_cell_xform: Transform3D, aabb: AABB, octree_size: Vector3, octree_cells: PackedByteArray, data_cells: PackedByteArray, distance_field: PackedByteArray, level_counts: PackedInt32Array)

AABB

get_bounds() const

PackedByteArray

get_data_cells() const

PackedInt32Array

get_level_counts() const

PackedByteArray

get_octree_cells() const

Vector3

get_octree_size() const

Transform3D

get_to_cell_xform() const


屬性說明

float bias = 1.5 🔗

間接光照和反射所使用的法線偏移。較高的值可以減少非粗糙材質中可見的自反射,但會增加光線洩漏並讓間接光照看上去更扁平。如果要優先隱藏自反射而不是追求光照質量,請將 bias 設為 0.0,並將 normal_bias 設為 1.02.0 之間的值。


float dynamic_range = 2.0 🔗

  • void set_dynamic_range(value: float)

  • float get_dynamic_range()

要使用的動態範圍(1.0 代表低動態範圍場景亮度)。較高的值可用於提供更明亮的間接光照,但會在較暗的區域產生更多可見的色帶效果(包括間接光照和反射)。為了避免色帶效果,建議將其設定得盡可能低,避免出現明顯的亮度截斷。


float energy = 1.0 🔗

  • void set_energy(value: float)

  • float get_energy()

VoxelGI 節點產生的間接照明和反射的能量。值越高,間接照明越亮。如果間接照明看起來過於平坦,請嘗試減少 propagation,同時增加 energy。另請參閱影響間接照明有效亮度的 use_two_bounces


bool interior = false 🔗

  • void set_interior(value: bool)

  • bool is_interior()

如果為 true,則 VoxelGI 節點會忽略 Environment 光照。如果為 false,則 VoxelGI 節點會考慮 Environment 光照。Environment 光照會即時更新,這意味著無需再次烘焙 VoxelGI 節點即可對其進行更改。


float normal_bias = 0.0 🔗

  • void set_normal_bias(value: float)

  • float get_normal_bias()

用於間接照明和反射的法線偏置。較高的值能夠減少在非粗糙材質中可見的自反射,但會導致更多可見的漏光問題,間接照明看起來也會更平坦。另見 bias。要優先隱藏自反射,而不是提高照明品質,請將 bias 設定為 0.0,並將 normal_bias 設定為介於 1.02.0 之間的值。


float propagation = 0.5 🔗

  • void set_propagation(value: float)

  • float get_propagation()

當光線從表面反彈時使用的乘數。較高的值會導致更亮的間接照明。如果間接照明看起來過於平坦,請嘗試減少 propagation 同時增加 energy。另請參閱影響間接照明的有效亮度的 use_two_bounces


bool use_two_bounces = true 🔗

  • void set_use_two_bounces(value: bool)

  • bool is_using_two_bounces()

如果為 true,則執行兩次間接照明反彈而不是一次。這使得以一個較低的性能成本,使間接照明看起來更自然、更明亮。第二次反彈在反射中也是可見的。如果啟用 use_two_bounces 後場景顯得太亮,請調整 propagationenergy


方法說明

void allocate(to_cell_xform: Transform3D, aabb: AABB, octree_size: Vector3, octree_cells: PackedByteArray, data_cells: PackedByteArray, distance_field: PackedByteArray, level_counts: PackedInt32Array) 🔗

There is currently no description for this method. Please help us by contributing one!


AABB get_bounds() const 🔗

返回一個 AABB,表示已烘焙體素資料的邊界,烘焙後應該與 VoxelGI.size 相配對(僅包含表示大小的 Vector3)。

注意:如果修改了大小但沒有對 VoxelGI 資料進行烘焙,則 get_bounds()VoxelGI.size 的值將不配對。


PackedByteArray get_data_cells() const 🔗

There is currently no description for this method. Please help us by contributing one!


PackedInt32Array get_level_counts() const 🔗

There is currently no description for this method. Please help us by contributing one!


PackedByteArray get_octree_cells() const 🔗

There is currently no description for this method. Please help us by contributing one!


Vector3 get_octree_size() const 🔗

There is currently no description for this method. Please help us by contributing one!


Transform3D get_to_cell_xform() const 🔗

There is currently no description for this method. Please help us by contributing one!