Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question Why are RenderTextures readable?

Discussion in 'General Graphics' started by opel_cobalt, Sep 10, 2023.

  1. opel_cobalt

    opel_cobalt

    Joined:
    May 18, 2021
    Posts:
    26
    Docs say that Texture.isReadable should only return true when a texture has cpu side pixel data which RenderTextures don't have, yet Texture.isReadable always returns true for RenderTextures. Why?

    If docs are inaccurate, what does Texture.isReadable actually mean?
     
  2. c0d3_m0nk3y

    c0d3_m0nk3y

    Joined:
    Oct 21, 2021
    Posts:
    624
    I can only guess.

    I think, isReadable means that there is a CPU side buffer for the pixels, but doesn't mean that it is up-to-date. You need to call ReadPixels or AsyncGPUReadback to update it from the GPU.

    Why is it true for RenderTextures? Probably because of this