Class for handling Sparse Textures.
Sparse textures are textures where not the whole texture data can be present in memory at once. They are also commonly called "tiled textures" or "mega textures".
Imagine a 16384x16384 texture at 32 bits per pixel - it would take 1GB of memory. The texture is broken down into rectangular "tiles", and each tile can either be present in memory or not. You can load & unload these tiles as needed based on distance from the camera, sectors of the world that the player has to see, etc.
Otherwise, the sparse textures behave just like any other texture in shaders - they can have mipmaps, can use all texture filtering modes, etc. If you happen to read from a tile that's not present, you can get undefined result (on many GPUs the result is a black color, but that's not guaranteed).
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. |
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 | Filtering mode of the texture. |
height | Height of the texture in pixels. (Read Only) |
mipMapBias | Mip map bias of the texture. |
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 game object. |
GetNativeTexturePtr | Retrieve a native (underlying graphics API) pointer to the texture resource. |
Destroy | Removes a gameobject, component or asset. |
DestroyImmediate | Destroys the object obj immediately. You are strongly recommended to use Destroy instead. |
DontDestroyOnLoad | Makes the object target not be destroyed automatically 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. |
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. |