RDSamplerState
繼承: RefCounted < Object
取樣器狀態(由 RenderingDevice 使用)。
說明
這個物件由 RenderingDevice 使用。
屬性
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
屬性說明
取樣時能夠使用的最大各向異性。僅在 use_anisotropy 為 true 時有效。值越高,傾斜角度下得到的取樣越銳利,但性能開銷也越大(由於顯存頻寬的原因)。這個值可能受到使用的圖形硬體的限制。大多數圖形硬體最多僅支援 16.0。
如果 anisotropy_max 為 1.0,則會強制禁用各向異性,即便 use_anisotropy 為 true。
SamplerBorderColor border_color = 2 🔗
void set_border_color(value: SamplerBorderColor)
SamplerBorderColor get_border_color()
對取樣器範圍外進行取樣,並且 repeat_u、repeat_v 或 repeat_w 的模式禁用了重複時,返回的邊框顏色。
CompareOperator compare_op = 7 🔗
void set_compare_op(value: CompareOperator)
CompareOperator get_compare_op()
要使用的比較運算。僅在 enable_compare 為 true 時有效。
如果為 true,則返回值基於 compare_op 定義的比較運算。這種做法基於硬體,因此比手動在著色器中執行要快。例如,算繪陰影貼圖時就會對陰影取樣器的深度值進行比較運算。
要使用的 mipmap LOD 偏置。正值會讓取樣器在給定距離處更模糊,而負值會讓取樣器在給定距離處更銳利(有可能看上去會很顆粒化)。推薦值在 -0.5 到 0.0 之間。僅在取樣器的 mipmap 可用時有效。
SamplerFilter mag_filter = 0 🔗
void set_mag_filter(value: SamplerFilter)
SamplerFilter get_mag_filter()
The sampler's magnification filter. It is the filtering method used when sampling texels that appear bigger than on-screen pixels.
用於顯示的最大 mipmap LOD 偏置(最低解析度)。僅在取樣器有 mipmap 可用時有效。
SamplerFilter min_filter = 0 🔗
void set_min_filter(value: SamplerFilter)
SamplerFilter get_min_filter()
The sampler's minification filter. It is the filtering method used when sampling texels that appear smaller than on-screen pixels.
用於顯示的最小 mipmap LOD 偏置(最高解析度)。僅在取樣器有 mipmap 可用時有效。
SamplerFilter mip_filter = 0 🔗
void set_mip_filter(value: SamplerFilter)
SamplerFilter get_mip_filter()
Mipmap 使用的篩選方法。
SamplerRepeatMode repeat_u = 2 🔗
void set_repeat_u(value: SamplerRepeatMode)
SamplerRepeatMode get_repeat_u()
沿著 UV 座標 U 軸的重複模式。影響取樣超出 UV 邊界時的返回值。
SamplerRepeatMode repeat_v = 2 🔗
void set_repeat_v(value: SamplerRepeatMode)
SamplerRepeatMode get_repeat_v()
沿著 UV 座標 V 軸的重複模式。影響取樣超出 UV 邊界時的返回值。
SamplerRepeatMode repeat_w = 2 🔗
void set_repeat_w(value: SamplerRepeatMode)
SamplerRepeatMode get_repeat_w()
沿著 UV 座標 W 軸的重複模式。影響取樣超出 UV 邊界時的返回值。僅對 3D 取樣器有效。
bool unnormalized_uvw = false 🔗
If true, the texture will be sampled with coordinates ranging from 0 to the texture's resolution. Otherwise, the coordinates will be normalized and range from 0 to 1.
如果為 true,則執行各向異性取樣。