Class for handling Sparse Textures.
Делимыми текстурами называются такие текстуры, чьи данные невозможно держать в памяти целиком. Их также часто называют «плиточными текстурами» (tiled textures) или «мегатекстурами» (mega textures).
Представьте себе текстуру размером 16384x16384 с разрядностью 32 бита на пиксель. Для загрузки такой текстуры целиком потребуется 1 ГБ памяти. Однако такую текстуру можно разбить на «плитки», каждая из которых может присутствовать или отсутствовать в памяти в отдельно взятый момент. Вы можете загружать и выгружать эти плитки в зависимости от их удаленности от камеры, фрагментов мира, которые должен видеть игрок, и т.д.
Иными словами, делимые текстуры ведут себя так же, как и любая другая текстура в шейдере: у них есть свойства множественного отображения (MIP mapping), на них может применяться любой способ фильтрации и т.д. Если вы попытаетесь прочитать данные плитки, не загруженной в память, вы можете получить неопределенный результат (на многих графических процессорах результатом будет черный цвет, однако это не гарантировано).
Note that not all hardware and platforms support sparse textures, so you should check SystemInfo.supportsSparseTextures before using them. For example, on DirectX systems they require DX11.2 (Windows 8.1) and a fairly recent GPU; and on OpenGL they require ARB_sparse_texture extension support.
After creating the sparse texture, query the tile size with tileWidth & tileHeight. Tile sizes are platform and GPU dependent.
Use UpdateTile or UpdateTileRaw to make a tile resident in memory and update its color data. Use UnloadTile to unload a tile.
See Also: Sparse Textures documentation page.
isCreated | Is the sparse texture actually created? (Read Only) |
tileHeight | Get sparse texture tile height (Read Only). |
tileWidth | Get sparse texture tile width (Read Only). |
SparseTexture | Create a sparse texture. |
UnloadTile | Unload sparse texture tile. |
UpdateTile | Update sparse texture tile with color values. |
UpdateTileRaw | Update sparse texture tile with raw pixel values. |
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 | The name of the object. |
anisoLevel | Anisotropic filtering level of the texture. |
dimension | Dimensionality (type) of the texture (Read Only). |
filterMode | Режим фильтрации текстур |
height | Height of the texture in pixels. (Read Only) |
imageContentsHash | The hash value of the Texture. |
mipMapBias | Mip map bias of the texture. |
updateCount | This counter is incremented when the texture is updated. |
width | Width of the texture in pixels. (Read Only) |
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 | Returns the instance id of the object. |
ToString | Returns the name of the GameObject. |
GetNativeTexturePtr | Retrieve a native (underlying graphics API) pointer to the texture resource. |
IncrementUpdateCount | Increment the update counter. |
Destroy | Удаляет GameObject, Component или Asset. |
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 | Returns the first active loaded object of Type type. |
FindObjectsOfType | Returns a list of all active loaded objects of Type type. |
Instantiate | Clones the object original and returns the clone. |
SetGlobalAnisotropicFilteringLimits | Sets Anisotropic limits. |
SetStreamingTextureMaterialDebugProperties | Uploads additional debug information to materials using textures set to stream mip maps. |
bool | Does the object exist? |
operator != | Compares if two objects refer to a different object. |
operator == | Compares two object references to see if they refer to the same object. |