Skip to main content
Search our knowledge base

How can I get pixels from unreadable textures?



  • Arnaud

    Typo in your script:

    // Create a new readable Texture2D to copy the pixels to it
    Texture2D myTexture2D = new Texture2D(texture.width, texture.width);

    Above has "width" twice. Supposed to be: 

    new Texture2D(texture.width, texture.height);

    Otherwise, it helped me a lot, thanks!


  • Sergio Gomez

    Fixed! thanks.

  • Crash Helmet

    Very helpful, thanks.

    Something I ran into afterwards; pixel coordinates for PC & iOS are different, as described here:

  • sama.van

    Very helpful for Standalone and Android but hours of pain of debugging from iOS.

    RenderTexture seems to be refreshed/cleared (Call it as you want) each time you call it from StandAlone and Android which let you use it for many texture in the same frame.

    On iOS, you should call it once a frame or that will just render the first one called.

    No idea why but the the per update trick is 100% working on iOS now.

    Running with Unity 2019.3.0f1


Article is closed for comments.