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.

RDTextureFormat

繼承: RefCounted < Object

紋理格式(由 RenderingDevice 使用)。

說明

這個物件由 RenderingDevice 使用。

屬性

int

array_layers

1

int

depth

1

DataFormat

format

8

int

height

1

bool

is_discardable

false

bool

is_resolve_buffer

false

int

mipmaps

1

TextureSamples

samples

0

TextureType

texture_type

1

BitField[TextureUsageBits]

usage_bits

0

int

width

1

方法

void

add_shareable_format(format: DataFormat)

void

remove_shareable_format(format: DataFormat)


屬性說明

int array_layers = 1 🔗

  • void set_array_layers(value: int)

  • int get_array_layers()

紋理的層數。僅適用於 2D 紋理陣列。


int depth = 1 🔗

  • void set_depth(value: int)

  • int get_depth()

紋理的深度(單位為圖元)。2D 紋理始終為 1


DataFormat format = 8 🔗

紋理的圖元資料格式。


int height = 1 🔗

  • void set_height(value: int)

  • int get_height()

紋理的高度(單位為圖元)。


bool is_discardable = false 🔗

  • void set_is_discardable(value: bool)

  • bool get_is_discardable()

If a texture is discardable, its contents do not need to be preserved between frames. This flag is only relevant when the texture is used as target in a draw list.

This information is used by RenderingDevice to figure out if a texture's contents can be discarded, eliminating unnecessary writes to memory and boosting performance.


bool is_resolve_buffer = false 🔗

  • void set_is_resolve_buffer(value: bool)

  • bool get_is_resolve_buffer()

The texture will be used as the destination of a resolve operation.


int mipmaps = 1 🔗

  • void set_mipmaps(value: int)

  • int get_mipmaps()

紋理中可用的 mipmap 數。


TextureSamples samples = 0 🔗

對紋理進行取樣時所使用的樣本數。


TextureType texture_type = 1 🔗

紋理型別。


BitField[TextureUsageBits] usage_bits = 0 🔗

紋理的用途位,決定使用該紋理時能做什麼。


int width = 1 🔗

  • void set_width(value: int)

  • int get_width()

紋理的寬度(單位為圖元)。


方法說明

void add_shareable_format(format: DataFormat) 🔗

Adds format as a valid format for the corresponding RDTextureView's RDTextureView.format_override property. If any format is added as shareable, then the main format must also be added.


void remove_shareable_format(format: DataFormat) 🔗

Removes format from the list of valid formats that the corresponding RDTextureView's RDTextureView.format_override property can be set to.