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...
RDPipelineMultisampleState¶
继承: RefCounted < Object
管线的多重采样状态(由 RenderingDevice 使用)。
描述¶
RDPipelineMultisampleState 控制的是在使用 RenderingDevice 进行渲染时,如何进行多重采样和超采样抗锯齿。
属性¶
|
||
|
||
|
||
|
||
|
||
|
属性说明¶
bool enable_alpha_to_coverage = false
如果为 true
,则启用 Alpha 为覆盖面。此时会根据片段的第一个颜色输出的 Alpha 分量生成临时的覆盖值。这样就能够让 Alpha 透明使用多重采样抗锯齿。
bool enable_alpha_to_one = false
如果为 true
,则会将 Alpha 强制为 0.0
或 1.0
。这样就能够让 Alpha 透明抗锯齿后的边缘更锐利。仅在 enable_alpha_to_coverage 为 true
时有效。
bool enable_sample_shading = false
如果为 true
,则会启用逐样本着色,使用 SSAA 代替 MSAA。这样能够提供更高质量的抗锯齿,支持透明边缘(Alpha 裁剪)。性能消耗很高。另见 min_sample_shading。详见逐样本着色 Vulkan 文档。
float min_sample_shading = 0.0
sample_count 的乘数,决定每个片段执行多少次采样。必须在 0.0
和 1.0
之间(含端点)。仅在 enable_sample_shading 为 true
时有效。如果 min_sample_shading 为 1.0
,则片段调用必须仅从覆盖索引样本中读取。如果 enable_sample_shading 不是 1.0
,则不能对平铺图像进行访问。
TextureSamples sample_count = 0
void set_sample_count ( TextureSamples value )
TextureSamples get_sample_count ( )
要进行 MSAA 采样的数量(如果 enable_sample_shading 为 true
则为 SSAA 采样)。值越高,抗锯齿效果越好,但会以性能为代价。
int[] sample_masks = []
样本掩码。详情见 Vulkan 的样本掩码文档。