Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


isReadable

Whether Unity stores an additional copy of this texture's pixel data in CPU-addressable memory.
Read time 1 minuteLast updated 4 days ago

Definition

  • Type: Property
  • Namespace: UnityEngine
  • Assembly: UnityEngine.CoreModule
public virtual bool isReadable { get; }

Remarks

This is required for methods that read, write, and manipulate the pixel data on the CPU, such as Texture2D.GetPixels or ImageConversion.EncodeToPNG. It is not required for methods that perform all their work on the GPU, such as Graphics.CopyTexture or Graphics.Blit.
By default, this is
false
for texture assets that you import into your project. To toggle this, use the Read/Write Enabled setting in the Texture Import Settings, or set TextureImporter.isReadable. If you're using the Particle System Shape Module or Terrain Paint Detail component, then you must enable this setting for Unity to render the textures properly in a Player build, or the build fails. Use the Game Objects view in Project Auditor (Window > Analysis > Project Auditor) to find and fix similar issues across your project.
By default, this is
true
when you create a texture from a script.
Note: Readable textures use more memory than non-readable textures. You should only make a texture readable when you need to, and you should make textures non-readable when you are done working with the data on the CPU.
To make a texture non-readable at runtime, call the
Apply
method for your type of texture, for example Texture2D.Apply or Cubemap.Apply and set the
makeNoLongerReadable
parameter to
true
.