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...
RDTextureFormat
继承: RefCounted < Object
纹理格式(由 RenderingDevice 使用)。
描述
这个对象由 RenderingDevice 使用。
属性
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
BitField[TextureUsageBits] |
|
|
|
方法
void |
add_shareable_format(format: DataFormat) |
void |
remove_shareable_format(format: DataFormat) |
属性说明
纹理的层数。仅适用于 2D 纹理数组。
纹理的深度(单位为像素)。2D 纹理始终为 1
。
DataFormat format = 8
🔗
void set_format(value: DataFormat)
DataFormat get_format()
纹理的像素数据格式。
纹理的高度(单位为像素)。
如果纹理可丢弃,则帧与帧之间不需要保留其内容。该标志仅在纹理作为绘制列表中的目标时相关。
RenderingDevice 会使用该信息来判断纹理的内容是否可丢弃,进而消除不必要的内存写入、提升性能。
bool is_resolve_buffer = false
🔗
该纹理将用作解析操作的目标。
纹理中可用的 mipmap 数。
TextureSamples samples = 0
🔗
void set_samples(value: TextureSamples)
TextureSamples get_samples()
对纹理进行采样时所使用的样本数。
TextureType texture_type = 1
🔗
void set_texture_type(value: TextureType)
TextureType get_texture_type()
纹理类型。
BitField[TextureUsageBits] usage_bits = 0
🔗
void set_usage_bits(value: BitField[TextureUsageBits])
BitField[TextureUsageBits] get_usage_bits()
纹理的用途位,决定使用该纹理时能做什么。
纹理的宽度(单位为像素)。
方法说明
将 format
添加为相应 RDTextureView 的 RDTextureView.format_override 属性的有效格式。如果将格式作为可共享格式添加,那么也必须添加主 format。
从相应 RDTextureView 的 RDTextureView.format_override 属性可以设置的有效格式列表中移除 format
。