TextureLayered

继承: Texture < Resource < RefCounted < Object

派生: CompressedTextureLayered, ImageTextureLayered, PlaceholderTextureLayered, TextureLayeredRD

包含多个Image数据的纹理类型的基类。每个图像的大小和格式相同。

描述

不能直接使用,但包含访问派生资源类型所需的所有函数。另请参见Texture3D

数据是按层设置的。对于Texture2DArray,层指定数组层。

所有图像都需要具有相同的宽度、高度和mipmap级别数。

可以使用ResourceLoader.load()加载TextureLayered

在内部,i3D将这些文件映射到目标渲染驱动程序(Vulkan、OpenGL3)中的相应文件。

方法

Format

_get_format() virtual const

int

_get_height() virtual const

Image

_get_layer_data(layer_index: int) virtual const

int

_get_layered_type() virtual const

int

_get_layers() virtual const

int

_get_width() virtual const

bool

_has_mipmaps() virtual const

Format

get_format() const

int

get_height() const

Image

get_layer_data(layer: int) const

LayeredType

get_layered_type() const

int

get_layers() const

int

get_width() const

bool

has_mipmaps() const


枚举

enum LayeredType: 🔗

LayeredType LAYERED_TYPE_2D_ARRAY = 0

Texture是一个通用的Texture2DArray

LayeredType LAYERED_TYPE_CUBEMAP = 1

纹理是一个Cubemap,每边都在自己的图层中(总共6个)。

LayeredType LAYERED_TYPE_CUBEMAP_ARRAY = 2

纹理是一个CubemapArray,每个立方体贴图由6层组成。


方法说明

Format _get_format() virtual const 🔗

查询TextureLayered的格式时调用。


int _get_height() virtual const 🔗

查询TextureLayered的高度时调用。


Image _get_layer_data(layer_index: int) virtual const 🔗

查询TextureLayered中图层的数据时调用。


int _get_layered_type() virtual const 🔗

在查询TextureLayered中的图层类型时调用。


int _get_layers() virtual const 🔗

查询TextureLayered中的层数时调用。


int _get_width() virtual const 🔗

查询TextureLayered的宽度时调用。


bool _has_mipmaps() virtual const 🔗

当查询TextureLayered中存在mipmap时调用。


Format get_format() const 🔗

返回此纹理使用的当前格式。有关详细信息,请参阅Format


int get_height() const 🔗

以像素为单位返回纹理的高度。高度通常由Y轴表示。


Image get_layer_data(layer: int) const 🔗

返回具有指定layer数据的Image资源。


LayeredType get_layered_type() const 🔗

返回TextureLayered的类型。该类型决定了数据的访问方式,立方体贴图具有特殊类型。


int get_layers() const 🔗

返回引用Image的数量。


int get_width() const 🔗

以像素为单位返回纹理的宽度。宽度通常由X轴表示。


bool has_mipmaps() const 🔗

如果图层已生成mipmap,则返回true