# SparseTexture

> Class for handling Sparse Textures.

## Definition

* **Type:** Class
* **Namespace:** [UnityEngine](/engine/6000.6/script-reference/unityengine.md)
* **Assembly:** UnityEngine.CoreModule
* **Inherits from:** [Texture](/engine/6000.6/script-reference/unityengine/texture.md)

```csharp
public sealed class SparseTexture : Texture
```

## Remarks

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).

Not all hardware and platforms support sparse textures, so you should check [SystemInfo.supportsSparseTextures](/engine/6000.6/script-reference/unityengine/systeminfo/supportssparsetextures.md) 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. Sparse textures only support non-compressed texture formats.

After creating the sparse texture, query the tile size with [SparseTexture.tileWidth](/engine/6000.6/script-reference/unityengine/sparsetexture/tilewidth.md) & [SparseTexture.tileHeight](/engine/6000.6/script-reference/unityengine/sparsetexture/tileheight.md). Tile sizes are platform and GPU dependent.

Use [SparseTexture.UpdateTile](/engine/6000.6/script-reference/unityengine/sparsetexture/updatetile.md) or [SparseTexture.UpdateTileRaw](/engine/6000.6/script-reference/unityengine/sparsetexture/updatetileraw.md) to make a tile resident in memory and update its color data. Use [SparseTexture.UnloadTile](/engine/6000.6/script-reference/unityengine/sparsetexture/unloadtile.md) to unload a tile.

Additional Resources: [ Sparse Textures](/engine/6000.6/manual/materials-and-shaders/textures/texture-loading/sparse-textures.md).

## Constructors

| Constructor                                                                                                                                                         | Description              |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------ |
| [SparseTexture(System.Int32,System.Int32,UnityEngine.TextureFormat,System.Int32,System.Boolean)](/engine/6000.6/script-reference/unityengine/sparsetexture/ctor.md) | Create a sparse texture. |

## Properties

| Property                                                                              | Description                                         |
| ------------------------------------------------------------------------------------- | --------------------------------------------------- |
| [isCreated](/engine/6000.6/script-reference/unityengine/sparsetexture/iscreated.md)   | Is the sparse texture actually created? (Read Only) |
| [tileHeight](/engine/6000.6/script-reference/unityengine/sparsetexture/tileheight.md) | Get sparse texture tile height (Read Only).         |
| [tileWidth](/engine/6000.6/script-reference/unityengine/sparsetexture/tilewidth.md)   | Get sparse texture tile width (Read Only).          |

## Methods

| Method                                                                                      | Description                                       |
| ------------------------------------------------------------------------------------------- | ------------------------------------------------- |
| [UnloadTile](/engine/6000.6/script-reference/unityengine/sparsetexture/unloadtile.md)       | Unload sparse texture tile.                       |
| [UpdateTile](/engine/6000.6/script-reference/unityengine/sparsetexture/updatetile.md)       | Update sparse texture tile with color values.     |
| [UpdateTileRaw](/engine/6000.6/script-reference/unityengine/sparsetexture/updatetileraw.md) | Update sparse texture tile with raw pixel values. |

## Inheritance

**Inherited Members:**

* [Texture.GenerateAllMips()](/engine/6000.6/script-reference/unityengine/texture/generateallmips.md)
* [Texture.SetGlobalAnisotropicFilteringLimits(int, int)](/engine/6000.6/script-reference/unityengine/texture/setglobalanisotropicfilteringlimits.md)
* [Texture.GetNativeTexturePtr()](/engine/6000.6/script-reference/unityengine/texture/getnativetextureptr.md)
* [Texture.IncrementUpdateCount()](/engine/6000.6/script-reference/unityengine/texture/incrementupdatecount.md)
* [Texture.SetStreamingTextureMaterialDebugProperties()](/engine/6000.6/script-reference/unityengine/texture/setstreamingtexturematerialdebugproperties.md#setstreamingtexturematerialdebugproperties\(\))
* [Texture.SetStreamingTextureMaterialDebugProperties(int)](/engine/6000.6/script-reference/unityengine/texture/setstreamingtexturematerialdebugproperties.md#setstreamingtexturematerialdebugproperties\(int\))
* [Texture.mipmapCount](/engine/6000.6/script-reference/unityengine/texture/mipmapcount.md)
* [Texture.graphicsFormat](/engine/6000.6/script-reference/unityengine/texture/graphicsformat.md)
* [Texture.width](/engine/6000.6/script-reference/unityengine/texture/width.md)
* [Texture.height](/engine/6000.6/script-reference/unityengine/texture/height.md)
* [Texture.dimension](/engine/6000.6/script-reference/unityengine/texture/dimension.md)
* [Texture.isReadable](/engine/6000.6/script-reference/unityengine/texture/isreadable.md)
* [Texture.wrapMode](/engine/6000.6/script-reference/unityengine/texture/wrapmode.md)
* [Texture.wrapModeU](/engine/6000.6/script-reference/unityengine/texture/wrapmodeu.md)
* [Texture.wrapModeV](/engine/6000.6/script-reference/unityengine/texture/wrapmodev.md)
* [Texture.wrapModeW](/engine/6000.6/script-reference/unityengine/texture/wrapmodew.md)
* [Texture.filterMode](/engine/6000.6/script-reference/unityengine/texture/filtermode.md)
* [Texture.anisoLevel](/engine/6000.6/script-reference/unityengine/texture/anisolevel.md)
* [Texture.mipMapBias](/engine/6000.6/script-reference/unityengine/texture/mipmapbias.md)
* [Texture.updateCount](/engine/6000.6/script-reference/unityengine/texture/updatecount.md)
* [Texture.isDataSRGB](/engine/6000.6/script-reference/unityengine/texture/isdatasrgb.md)
* [Texture.imageContentsHash](/engine/6000.6/script-reference/unityengine/texture/imagecontentshash.md)
* [Texture.totalTextureMemory](/engine/6000.6/script-reference/unityengine/texture/totaltexturememory.md)
* [Texture.desiredTextureMemory](/engine/6000.6/script-reference/unityengine/texture/desiredtexturememory.md)
* [Texture.targetTextureMemory](/engine/6000.6/script-reference/unityengine/texture/targettexturememory.md)
* [Texture.currentTextureMemory](/engine/6000.6/script-reference/unityengine/texture/currenttexturememory.md)
* [Texture.nonStreamingTextureMemory](/engine/6000.6/script-reference/unityengine/texture/nonstreamingtexturememory.md)
* [Texture.streamingMipmapUploadCount](/engine/6000.6/script-reference/unityengine/texture/streamingmipmapuploadcount.md)
* [Texture.streamingRendererCount](/engine/6000.6/script-reference/unityengine/texture/streamingrenderercount.md)
* [Texture.streamingTextureCount](/engine/6000.6/script-reference/unityengine/texture/streamingtexturecount.md)
* [Texture.nonStreamingTextureCount](/engine/6000.6/script-reference/unityengine/texture/nonstreamingtexturecount.md)
* [Texture.streamingTexturePendingLoadCount](/engine/6000.6/script-reference/unityengine/texture/streamingtexturependingloadcount.md)
* [Texture.streamingTextureLoadingCount](/engine/6000.6/script-reference/unityengine/texture/streamingtextureloadingcount.md)
* [Texture.streamingTextureForceLoadAll](/engine/6000.6/script-reference/unityengine/texture/streamingtextureforceloadall.md)
* [Texture.streamingTextureDiscardUnusedMips](/engine/6000.6/script-reference/unityengine/texture/streamingtexturediscardunusedmips.md)
* [Texture.allowThreadedTextureCreation](/engine/6000.6/script-reference/unityengine/texture/allowthreadedtexturecreation.md)
* [Texture.graphicsTexture](/engine/6000.6/script-reference/unityengine/texture/graphicstexture.md)
* [Object.GetEntityId()](/engine/6000.6/script-reference/unityengine/object/getentityid.md)
* [Object.GetHashCode()](/engine/6000.6/script-reference/unityengine/object/gethashcode.md)
* [Object.InstantiateAsync\<T>(T)](/engine/6000.6/script-reference/unityengine/object/instantiateasync.md)
* [Object.InstantiateAsync\<T>(T, Transform)](/engine/6000.6/script-reference/unityengine/object/instantiateasync.md)
* [Object.InstantiateAsync\<T>(T, Vector3, Quaternion)](/engine/6000.6/script-reference/unityengine/object/instantiateasync.md)
* [Object.InstantiateAsync\<T>(T, Transform, Vector3, Quaternion)](/engine/6000.6/script-reference/unityengine/object/instantiateasync.md)
* [Object.InstantiateAsync\<T>(T, int)](/engine/6000.6/script-reference/unityengine/object/instantiateasync.md)
* [Object.InstantiateAsync\<T>(T, int, Transform)](/engine/6000.6/script-reference/unityengine/object/instantiateasync.md)
* [Object.InstantiateAsync\<T>(T, int, Vector3, Quaternion)](/engine/6000.6/script-reference/unityengine/object/instantiateasync.md)
* [Object.InstantiateAsync\<T>(T, int, ReadOnlySpan\<Vector3>, ReadOnlySpan\<Quaternion>)](/engine/6000.6/script-reference/unityengine/object/instantiateasync.md)
* [Object.InstantiateAsync\<T>(T, int, Transform, Vector3, Quaternion)](/engine/6000.6/script-reference/unityengine/object/instantiateasync.md)
* [Object.InstantiateAsync\<T>(T, int, Transform, Vector3, Quaternion, CancellationToken)](/engine/6000.6/script-reference/unityengine/object/instantiateasync.md)
* [Object.InstantiateAsync\<T>(T, int, Transform, ReadOnlySpan\<Vector3>, ReadOnlySpan\<Quaternion>)](/engine/6000.6/script-reference/unityengine/object/instantiateasync.md)
* [Object.InstantiateAsync\<T>(T, int, Transform, ReadOnlySpan\<Vector3>, ReadOnlySpan\<Quaternion>, CancellationToken)](/engine/6000.6/script-reference/unityengine/object/instantiateasync.md)
* [Object.InstantiateAsync\<T>(T, InstantiateParameters, CancellationToken)](/engine/6000.6/script-reference/unityengine/object/instantiateasync.md)
* [Object.InstantiateAsync\<T>(T, int, InstantiateParameters, CancellationToken)](/engine/6000.6/script-reference/unityengine/object/instantiateasync.md)
* [Object.InstantiateAsync\<T>(T, Vector3, Quaternion, InstantiateParameters, CancellationToken)](/engine/6000.6/script-reference/unityengine/object/instantiateasync.md)
* [Object.InstantiateAsync\<T>(T, int, Vector3, Quaternion, InstantiateParameters, CancellationToken)](/engine/6000.6/script-reference/unityengine/object/instantiateasync.md)
* [Object.InstantiateAsync\<T>(T, int, ReadOnlySpan\<Vector3>, ReadOnlySpan\<Quaternion>, InstantiateParameters, CancellationToken)](/engine/6000.6/script-reference/unityengine/object/instantiateasync.md)
* [Object.Instantiate(Object, Vector3, Quaternion)](/engine/6000.6/script-reference/unityengine/object/instantiate.md#instantiate\(object-vector3-quaternion\))
* [Object.Instantiate(Object, Vector3, Quaternion, Transform)](/engine/6000.6/script-reference/unityengine/object/instantiate.md#instantiate\(object-vector3-quaternion-transform\))
* [Object.Instantiate(Object)](/engine/6000.6/script-reference/unityengine/object/instantiate.md#instantiate\(object\))
* [Object.Instantiate(Object, Scene)](/engine/6000.6/script-reference/unityengine/object/instantiate.md#instantiate\(object-scene\))
* [Object.Instantiate\<T>(T, InstantiateParameters)](/engine/6000.6/script-reference/unityengine/object/instantiate.md)
* [Object.Instantiate\<T>(T, Vector3, Quaternion, InstantiateParameters)](/engine/6000.6/script-reference/unityengine/object/instantiate.md)
* [Object.Instantiate(Object, Transform)](/engine/6000.6/script-reference/unityengine/object/instantiate.md#instantiate\(object-transform\))
* [Object.Instantiate(Object, Transform, bool)](/engine/6000.6/script-reference/unityengine/object/instantiate.md#instantiate\(object-transform-bool\))
* [Object.Instantiate\<T>(T)](/engine/6000.6/script-reference/unityengine/object/instantiate.md)
* [Object.Instantiate\<T>(T, Vector3, Quaternion)](/engine/6000.6/script-reference/unityengine/object/instantiate.md)
* [Object.Instantiate\<T>(T, Vector3, Quaternion, Transform)](/engine/6000.6/script-reference/unityengine/object/instantiate.md)
* [Object.Instantiate\<T>(T, Transform)](/engine/6000.6/script-reference/unityengine/object/instantiate.md)
* [Object.Instantiate\<T>(T, Transform, bool)](/engine/6000.6/script-reference/unityengine/object/instantiate.md)
* [Object.Destroy(Object, float)](/engine/6000.6/script-reference/unityengine/object/destroy.md)
* [Object.DestroyImmediate(Object, bool)](/engine/6000.6/script-reference/unityengine/object/destroyimmediate.md)
* [Object.FindObjectsByType(Type)](/engine/6000.6/script-reference/unityengine/object/findobjectsbytype.md#findobjectsbytype\(type\))
* [Object.FindObjectsByType(Type, FindObjectsInactive)](/engine/6000.6/script-reference/unityengine/object/findobjectsbytype.md#findobjectsbytype\(type-findobjectsinactive\))
* [Object.DontDestroyOnLoad(Object)](/engine/6000.6/script-reference/unityengine/object/dontdestroyonload.md)
* [Object.FindAnyObjectByType\<T>()](/engine/6000.6/script-reference/unityengine/object/findanyobjectbytype.md#findanyobjectbytypet\(\))
* [Object.FindAnyObjectByType\<T>(FindObjectsInactive)](/engine/6000.6/script-reference/unityengine/object/findanyobjectbytype.md#findanyobjectbytypet\(findobjectsinactive\))
* [Object.FindObjectsByType\<T>()](/engine/6000.6/script-reference/unityengine/object/findobjectsbytype.md#findobjectsbytypet\(\))
* [Object.FindObjectsByType\<T>(FindObjectsInactive)](/engine/6000.6/script-reference/unityengine/object/findobjectsbytype.md#findobjectsbytypet\(findobjectsinactive\))
* [Object.FindAnyObjectByType(Type)](/engine/6000.6/script-reference/unityengine/object/findanyobjectbytype.md#findanyobjectbytype\(type\))
* [Object.FindAnyObjectByType(Type, FindObjectsInactive)](/engine/6000.6/script-reference/unityengine/object/findanyobjectbytype.md#findanyobjectbytype\(type-findobjectsinactive\))
* [Object.ToString()](/engine/6000.6/script-reference/unityengine/object/tostring.md)
* [Object.name](/engine/6000.6/script-reference/unityengine/object/name.md)
* [Object.hideFlags](/engine/6000.6/script-reference/unityengine/object/hideflags.md)

### Operators

| Operator                                                                           | Description                                                             |
| ---------------------------------------------------------------------------------- | ----------------------------------------------------------------------- |
| [operator ==](/engine/6000.6/script-reference/unityengine/object/op-equality.md)   | Compares two object references to see if they refer to the same object. |
| [bool](/engine/6000.6/script-reference/unityengine/object/op-implicit.md)          | Determines whether the object exists.                                   |
| [operator !=](/engine/6000.6/script-reference/unityengine/object/op-inequality.md) | Compares if two objects refer to a different object.                    |
