Up to date

This page is up to date for Godot 4.2. If you still find outdated information, please open an issue.

Texture2DArray

继承: ImageTextureLayered < TextureLayered < Texture < Resource < RefCounted < Object

由多个独立图像构成的单个纹理资源。每个图像的尺寸和 mipmap 级别数都相同。

描述

Texture2DArray 与 Texture3D 不同:Texture2DArray 不支持在 Image 之间进行三线性插值,即不会进行混合。另见 CubemapCubemapArray,这些纹理数组具有针对立方体贴图设计的函数。

Texture2DArray 与 AtlasTexture 也不同:Texture2DArray 中的图形都是单独处理的。而在图集中,区域(即单张图像)的大小可以不同。此外,你通常会需要围绕区域添加边距,防止 UV 映射意外进入多个区域。多级渐远纹理 mipmap 也是一样:每一层的 mipmap 链都是单独处理的。而在图集中,需要在片段着色器中手动切片。

要自己创建这样的纹理文件,请使用 Godot 编辑器导入预设重新导入图像文件。

方法

Resource

create_placeholder ( ) const


方法说明

Resource create_placeholder ( ) const

创建该资源的占位符版本(PlaceholderTexture2DArray)。