スパーステクスチャを処理するためのクラス
スパーステクスチャは全テクスチャデータが一度にメモリに存在するのではないテクスチャです。これらは一般的に"タイル状のテクスチャ"や"メガテクスチャと呼ばれています。
ピクセルあたり 32 ビットで 16384x16384 のテクスチャを想像してみよう - それは 1GB のメモリを取るでしょう。テクスチャは長方形の"タイルに分割され、各タイルはメモリ内か外のいずれかに存在することができます。カメラからの距離、プレイヤーが見えている世界での活動範囲などに基づいて、必要に応じてこれらのタイルをロードとアンロードすることができます。
それ以外では、スパーステクスチャはシェーダー内の他のテクスチャと同じように扱えます - ミップマップを持たせる、テクスチャフィルタリングモードを使う、等々。存在しないタイルを読み取るようなことが起きた場合は、未定義の結果を得ることになります(多くの GPU 上では黒色になりますが、必ずそうなるとは限りません)。
すべてのハードウェアとプラットホームでスパーステクスチャがサポートされている訳ではないので、使用する前に SystemInfo.supportsSparseTextures をチェックしてください。例えば、 DirectX では、 DX11.2 (Windows 8.1) と、それなりに新しい GPU が必要になります。 OpenGL では、 ARB_sparse_texture エクステンションサポートが必要です。
スパーステクスチャを作成した後、 tileWidth と tileHeight のタイルサイズを照会します。タイルサイズはプラットフォームと GPU に依存します。
タイルをメモリに常駐し、その色のデータを更新するために UpdateTile や UpdateTileRaw を使用します。タイルをアンロードするために UnloadTile を使用します。
関連項目: Sparse Textures
| isCreated | スパーステクスチャを実際に作成するか。(Read Only) |
| tileHeight | スパーステクスチャタイルの高さを取得します。(Read Only) |
| tileWidth | スパーステクスチャタイルの幅を取得します。(Read Only) |
| SparseTexture | スパーステクスチャを作成する。 |
| UnloadTile | スパーステクスチャファイルをアンロードします。 |
| UpdateTile | カラー値を持つスパーステクスチャのタイルを更新します。 |
| UpdateTileRaw | RAW のピクセル値でスパーステクスチャファイルを更新します。 |
| currentTextureMemory | The amount of memory currently being used by textures. |
| desiredTextureMemory | This amount of texture memory would be used before the texture streaming budget is applied. |
| nonStreamingTextureCount | Number of non-streaming textures. |
| nonStreamingTextureMemory | Total amount of memory being used by non-streaming textures. |
| streamingMipmapUploadCount | How many times has a texture been uploaded due to texture mipmap streaming. |
| streamingRendererCount | Number of renderers registered with the texture streaming system. |
| streamingTextureCount | Number of streaming textures. |
| streamingTextureDiscardUnusedMips | Force the streaming texture system to discard all unused mipmaps immediately, rather than caching them until the texture memory budget is exceeded. |
| streamingTextureForceLoadAll | Force streaming textures to load all mipmap levels. |
| streamingTextureLoadingCount | Number of streaming textures with mipmaps currently loading. |
| streamingTexturePendingLoadCount | Number of streaming textures with outstanding mipmaps to be loaded. |
| targetTextureMemory | The amount of memory used by textures after the mipmap streaming and budget are applied and loading is complete. |
| totalTextureMemory | The total amount of memory that would be used by all textures at mipmap level 0. |
| hideFlags | Should the object be hidden, saved with the Scene or modifiable by the user? |
| name | オブジェクト名 |
| anisoLevel | テクスチャの異方性フィルタリングのレベル |
| dimension | テクスチャの次元 (タイプ)。読み取り専用。 |
| filterMode | テクスチャのフィルタリングモード |
| height | ピクセル単位でのテクスチャの高さ(読み取り専用) |
| imageContentsHash | The hash value of the Texture. |
| mipMapBias | ミップマップのバイアス |
| updateCount | This counter is incremented when the texture is updated. |
| width | ピクセル単位でのテクスチャの幅(読み取り専用) |
| wrapMode | Texture coordinate wrapping mode. |
| wrapModeU | Texture U coordinate wrapping mode. |
| wrapModeV | Texture V coordinate wrapping mode. |
| wrapModeW | Texture W coordinate wrapping mode for Texture3D. |
| GetInstanceID | オブジェクトのインスタンス ID を返します |
| ToString | Returns the name of the GameObject. |
| GetNativeTexturePtr | テクスチャリソースへのネイティブ (グラフィックス API に内在する) ポインターを取得します。 |
| IncrementUpdateCount | Increment the update counter. |
| Destroy | ゲームオブジェクトやコンポーネント、アセットを削除します |
| DestroyImmediate | Destroys the object obj immediately. You are strongly recommended to use Destroy instead. |
| DontDestroyOnLoad | Do not destroy the target Object when loading a new Scene. |
| FindObjectOfType | タイプ type から最初に見つけたアクティブのオブジェクトを返します |
| FindObjectsOfType | タイプから見つけたすべてのアクティブのオブジェクト配列を返します |
| Instantiate | original のオブジェクトをクローンします |
| SetGlobalAnisotropicFilteringLimits | 異方性のリミットを設定します |
| SetStreamingTextureMaterialDebugProperties | Uploads additional debug information to materials using textures set to stream mip maps. |
| bool | オブジェクトが存在するかどうか |
| operator != | 二つのオブジェクトが異なるオブジェクトを参照しているか比較します |
| operator == | 2つのオブジェクト参照が同じオブジェクトを参照しているか比較します。 |