Skip to content

格式

typescript
Texture.graphicFormat

所属类: Texture

描述

(只读)当前纹理的像素格式。

像素格式影响了纹理在内存中的占用空间和在 GPU 上的性能表现。不同的像素格式适用于不同的纹理用途,如颜色贴图、法线贴图、深度纹理等。详细介绍见GraphicsFormat。

参数

参数名类型描述

返回值

类型描述
GraphicsFormat当前纹理的像素格式。

代码示例

typescript
let texture = Resources.Load<Texture>(Texture, "textureId");
texture.graphicFormat;