Version: 2017.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 を使って確認できます。

変数

depthテクスチャ配列の要素の数 (読み込み専用)
formatテクスチャ形式 (読み込み専用)

コンストラクタ

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

Public 関数

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

継承メンバー

変数

hideFlagsオブジェクトは非表示、シーンに保存、ユーザーが編集可能、などを設定する。
nameオブジェクト名
anisoLevelテクスチャの異方性フィルタリングのレベル
dimensionテクスチャの次元 (タイプ)。読み取り専用。
filterModeテクスチャのフィルタリングモード
heightピクセル単位でのテクスチャの高さ(読み取り専用)
imageContentsHashThe hash value of the Texture.
mipMapBiasミップマップのバイアス
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 GameObject.
GetNativeTexturePtrテクスチャリソースへのネイティブ (グラフィックス API に内在する) ポインターを取得します。

Static 関数

Destroyゲームオブジェクトやコンポーネント、アセットを削除します
DestroyImmediateDestroys the object obj immediately. You are strongly recommended to use Destroy instead.
DontDestroyOnLoad新しいシーンを読み込んでもオブジェクトが自動で破壊されないように設定します
FindObjectOfTypeタイプ type から最初に見つけたアクティブのオブジェクトを返します
FindObjectsOfTypeタイプから見つけたすべてのアクティブのオブジェクト配列を返します
Instantiateoriginal のオブジェクトをクローンします
SetGlobalAnisotropicFilteringLimits異方性のリミットを設定します

Operator

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