CubemapArray

class in UnityEngine

/

Inherits from:Texture

Switch to Manual

Description

处理立方体贴图数组的类。

现代图形 API(例如 D3D10.1 及更高版本、OpenGL 4.0 及更高版本、MacOS 上的 Metal、PS4)支持“立方体贴图数组”, 它们是具有相同大小和格式的立方体贴图的数组。从着色器方面讲,它们被视为单个资源, 对它们进行采样需要一个额外的坐标,用于指示将从中采样的数组元素。

通常,立方体贴图数组适用于实现高效的反射探针、光照和阴影系统 (单个数组中的所有反射/剪影/阴影立方体贴图)。

立方体贴图数组没有专用的导入管线,必须在运行时或在 Editor 脚本中通过代码创建 它们。使用 Graphics.CopyTexture 有助于将像素数据快速从常规 Cubemap 纹理复制到 立方体贴图数组的纹理中。通过 Editor 脚本,创建序列化立方体贴图数组的常用方式是创建它, 填充数据(通过常规立方体贴图中的 Graphics.CopyTexture,或者通过 SetPixelsSetPixels32),然后通过 AssetDatabase.CreateAsset 将其另存为资源。

注意,并非所有平台和 GPU 都支持立方体贴图数组;例如,当前任何移动 API/GPU 都不支持它们。使用 SystemInfo.supportsCubemapArrayTextures 进行检查。

Variables

cubemapCount该数组中立方体贴图的数量(只读)。
format纹理格式(只读)。

Constructors

CubemapArray创建一个新的立方体贴图数组。

Public Functions

Apply实际应用先前的全部 SetPixels 更改。
GetPixels返回单个数组切片/面的像素颜色。
GetPixels32返回单个数组切片/面的像素颜色。
SetPixels为单个数组切片/面设置像素颜色。
SetPixels32为单个数组切片/面设置像素颜色。

Inherited members

Static Variables

currentTextureMemoryThe amount of memory currently being used by textures.
desiredTextureMemoryThis amount of texture memory would be used before the texture streaming budget is applied.
nonStreamingTextureCountNumber of non-streaming textures.
nonStreamingTextureMemoryTotal amount of memory being used by non-streaming textures.
streamingMipmapUploadCountHow many times has a texture been uploaded due to texture mipmap streaming.
streamingRendererCountNumber of renderers registered with the texture streaming system.
streamingTextureCountNumber of streaming textures.
streamingTextureDiscardUnusedMipsForce the streaming texture system to discard all unused mipmaps immediately, rather than caching them until the texture memory budget is exceeded.
streamingTextureForceLoadAllForce streaming textures to load all mipmap levels.
streamingTextureLoadingCountNumber of streaming textures with mipmaps currently loading.
streamingTexturePendingLoadCountNumber of streaming textures with outstanding mipmaps to be loaded.
targetTextureMemoryThe amount of memory used by textures after the mipmap streaming and budget are applied and loading is complete.
totalTextureMemoryThe total amount of memory that would be used by all textures at mipmap level 0.

Variables

hideFlagsShould the object be hidden, saved with the Scene or modifiable by the user?
name对象的名称。
anisoLevel纹理的各向异性过滤级别。
dimension纹理的维度(类型)(只读)。
filterMode纹理的过滤模式。
height纹理的高度(以像素为单位)。(只读)
imageContentsHash纹理的哈希值。
isReadableReturns true if the Read/Write Enabled checkbox was checked when the texture was imported; otherwise returns false. For a dynamic Texture created from script, always returns true. For additional information, see TextureImporter.isReadable.
mipMapBias纹理的多级渐进纹理偏差。
updateCount更新纹理时,此计数器会递增。
width纹理的宽度(以像素为单位)。(只读)
wrapMode纹理坐标换行模式。
wrapModeU纹理 U 坐标换行模式。
wrapModeV纹理 V 坐标换行模式。
wrapModeW Texture3D 的纹理 W 坐标换行模式。

Public Functions

GetInstanceID返回对象的实例 ID。
ToString返回 GameObject 的名称。
GetNativeTexturePtr获取指向纹理资源的原生(底层图形 API)指针。
IncrementUpdateCount递增更新计数器。

Static Functions

Destroy删除 GameObject、组件或资源。
DestroyImmediate立即销毁对象 /obj/。强烈建议您改用 Destroy。
DontDestroyOnLoadDo not destroy the target Object when loading a new Scene.
FindObjectOfType返回第一个类型为 type 的已加载的激活对象。
FindObjectsOfType返回所有类型为 type 的已加载的激活对象的列表。
Instantiate克隆 original 对象并返回克隆对象。
SetGlobalAnisotropicFilteringLimits设置各向异性限制。
SetStreamingTextureMaterialDebugPropertiesUploads additional debug information to materials using textures set to stream mip maps.

Operators

bool该对象是否存在?
operator !=比较两个对象是否引用不同的对象。
operator ==比较两个对象引用,判断它们是否引用同一个对象。