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.

RDPipelineMultisampleState

繼承: RefCounted < Object

管線的多重取樣狀態(由 RenderingDevice 使用)。

說明

RDPipelineMultisampleState 控制的是在使用 RenderingDevice 進行算繪時,如何進行多重取樣和超取樣抗鋸齒。

屬性

bool

enable_alpha_to_coverage

false

bool

enable_alpha_to_one

false

bool

enable_sample_shading

false

float

min_sample_shading

0.0

TextureSamples

sample_count

0

Array[int]

sample_masks

[]


屬性說明

bool enable_alpha_to_coverage = false 🔗

  • void set_enable_alpha_to_coverage(value: bool)

  • bool get_enable_alpha_to_coverage()

如果為 true,則啟用 Alpha 為覆蓋面。此時會根據片段的第一個顏色輸出的 Alpha 分量生成臨時的覆蓋值。這樣就能夠讓 Alpha 透明使用多重取樣抗鋸齒。


bool enable_alpha_to_one = false 🔗

  • void set_enable_alpha_to_one(value: bool)

  • bool get_enable_alpha_to_one()

如果為 true,則會將 Alpha 強制為 0.01.0。這樣就能夠讓 Alpha 透明抗鋸齒後的邊緣更銳利。僅在 enable_alpha_to_coveragetrue 時有效。


bool enable_sample_shading = false 🔗

  • void set_enable_sample_shading(value: bool)

  • bool get_enable_sample_shading()

如果為 true,則會啟用逐樣本著色,使用 SSAA 代替 MSAA。這樣能夠提供更高品質的抗鋸齒,支援透明邊緣(Alpha 裁剪)。性能消耗很高。另見 min_sample_shading。詳見逐樣本著色 Vulkan 文件


float min_sample_shading = 0.0 🔗

  • void set_min_sample_shading(value: float)

  • float get_min_sample_shading()

sample_count 的乘數,決定每個片段執行多少次取樣。必須在 0.01.0 之間(含端點)。僅在 enable_sample_shadingtrue 時有效。如果 min_sample_shading1.0,則片段呼叫必須僅從覆蓋索引樣本中讀取。如果 enable_sample_shading 不是 1.0,則不能對平鋪圖像進行存取。


TextureSamples sample_count = 0 🔗

要進行 MSAA 取樣的數量(如果 enable_sample_shadingtrue 則為 SSAA 取樣)。值越高,抗鋸齒效果越好,但會以性能為代價。


Array[int] sample_masks = [] 🔗

樣本遮罩。詳情見 Vulkan 的樣本遮罩文件