Version: 2019.4

Texture2DArray

class in UnityEngine

/

継承:Texture

マニュアルに切り替える

説明

2D テクスチャ配列を扱うクラス

Modern graphics APIs (e.g. D3D10 and later, OpenGL ES 3.0 and later, Metal etc.) support "texture arrays", which is an array of same size & format textures. From the shader side, they are treated as a single resource, and sampling them needs an extra coordinate that indicates which array element to sample from.

一般的に、テクスチャ配列はテクスチャアトラスの代替えとして使われます。また、他の場合では、オブジェクトが 1 組の同サイズのテクスチャ (例えば、テレインなど) を使用するときなどに便利です。

Currently in Unity texture arrays do not have an import pipeline for them, and must be created from code, either at runtime or in editor scripts. Using Graphics.CopyTexture is useful for fast copying of pixel data from regular 2D textures into elements of a texture array. From editor scripts, a common way of creating serialized texture array is to create it, fill with data (either via Graphics.CopyTexture from regular 2D textures, or via SetPixels or SetPixels32) and save it as an asset via AssetDatabase.CreateAsset.

すべてのプラットフォームと GPU がテクスチャ配列をサポートしているわけではないことに注意してください。例えば、Direct3D9 と OpenGL ES 2.0 はサポートしていません。SystemInfo.supports2DArrayTextures を使って確認できます。

Static 変数

allSlicesRead Only. This property is used as a parameter in some overloads of the CommandBuffer.Blit, Graphics.Blit, CommandBuffer.SetRenderTarget, and Graphics.SetRenderTarget methods to indicate that all texture array slices are bound. The value of this property is -1.

変数

depthテクスチャ配列の要素の数 (読み込み専用)
formatテクスチャ形式 (読み込み専用)
isReadableReturns true if this texture array is Read/Write Enabled; otherwise returns false. For dynamic textures created from script, always returns true.

コンストラクタ

Texture2DArray新しいテクスチャ配列を作成

Public 関数

Apply SetPixels で変更された設定をすべて適用します
GetPixels1 つの配列スライスのピクセルの色を返します。
GetPixels321 つの配列スライスのピクセルの色を返します。
SetPixelDataSet pixel values from raw preformatted data.
SetPixels全体のミップレベルのピクセルの色を設定します。
SetPixels32全体のミップレベルのピクセルの色を設定します。

継承メンバー

Static 変数

allowThreadedTextureCreationAllow texture creation to occur on any thread (rather than the dedicated render thread).
currentTextureMemoryThe amount of memory currently being used by textures.
desiredTextureMemoryThis amount of texture memory would be used before the texture streaming budget is applied.
GenerateAllMipsCan be used with texture constructors that take a mip count to indicate that all mips should be generated. The value of this field is -1.
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.

変数

hideFlagsShould the object be hidden, saved with the Scene or modifiable by the user?
nameオブジェクト名
anisoLevelテクスチャの異方性フィルタリングのレベル
dimensionテクスチャの次元 (タイプ)。読み取り専用。
filterModeテクスチャのフィルタリングモード
graphicsFormatReturns the GraphicsFormat format or color format of a texture object.
heightピクセル単位でのテクスチャの高さ(読み取り専用)
imageContentsHashThe hash value of the Texture.
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ミップマップのバイアス
mipmapCountテクスチャのミップマップレベル(読み取り専用)
updateCountThis counter is incremented when the texture is updated.
widthピクセル単位でのテクスチャの幅(読み取り専用)
wrapModeTexture coordinate wrapping mode.
wrapModeUTexture U coordinate wrapping mode.
wrapModeVTexture V coordinate wrapping mode.
wrapModeWTexture W coordinate wrapping mode for Texture3D.

Public 関数

GetInstanceIDオブジェクトのインスタンス ID を返します
ToStringReturns the name of the object.
GetNativeTexturePtrテクスチャリソースへのネイティブ (グラフィックス API に内在する) ポインターを取得します。
IncrementUpdateCountIncrement the update counter.

Static 関数

DestroyRemoves a GameObject, component or asset.
DestroyImmediateDestroys the object obj immediately. You are strongly recommended to use Destroy instead.
DontDestroyOnLoadDo not destroy the target Object when loading a new Scene.
FindObjectOfTypeタイプ type から最初に見つけたアクティブのオブジェクトを返します
FindObjectsOfTypeタイプから見つけたすべてのアクティブのオブジェクト配列を返します
Instantiateoriginal のオブジェクトをクローンします
SetGlobalAnisotropicFilteringLimits異方性のリミットを設定します
SetStreamingTextureMaterialDebugPropertiesUploads additional debug information to materials using textures set to stream mip maps.

Operator

boolオブジェクトが存在するかどうか
operator !=二つのオブジェクトが異なるオブジェクトを参照しているか比較します
operator ==2つのオブジェクト参照が同じオブジェクトを参照しているか比較します。