Search Issue Tracker

Feature Request

Feature Request in 2023.1.X

Votes

0

Found in

2020.3.39f1

2021.3.9f1

2022.1.16f1

2022.2.0b7

2023.1.0a9

Issue ID

UUM-13615

Regression

No

The resulting texture is empty when serializing a region copied by Graphics.CopyTexture

Graphics Device Features

-

Reproduction steps:
1. Open the “IN-15493_CopyTexture“ project and open the “TextureCopyTest“ scene
2. Enter and exit the Play mode
3. Observe the “Assets/Textures/CopiedTextureNotWorking” texture
4. Reimport it and observe it again

Expected result: “CopiedTextureNotWorking” looks the same as “CopiedTexture“ before and after reimporting
Actual result: “CopiedTextureNotWorking” is white (empty) before and/or after reimporting

Reproduced in: 2020.3.0f1, 2020.3.39f1, 2021.3.9f1, 2022.1.16f1, 2022.2.0b7, 2023.1.0a9

Reproduced OS: Windows 11, macOS Monterey 12.0.1

Notes:
1. Copied with Graphics.CopyTexture(Texture, int, int, int, int, int, int, Texture, int, int, int, int)
2. Not reproduced with Graphics.CopyTexture(Texture, int, int, Texture, int, int)

  1. Resolution Note:

    Asset serialization can only serialize data that is available on the CPU so a CPU copy is necessary beforehand. Graphics.CopyTexture only additionally copies CPU data if both the src and dst textures are Read/Write enabled, with some additional restrictions:
    In this case specifically, when the format is compressed, region-only CPU copies via Graphics.CopyTexture are not supported by Unity at this time due to complexity. This would be a feature request, not a bugfix. This can be worked around if the format is not compressed, if the entire mip is copied via the appropriate overload, or if the data is separately copied to the CPU via the alternate function GetPixels, which is meant for that purpose.

  2. Resolution Note (2023.1.X):

    Asset serialization can only serialize data that is available on the CPU so a CPU copy is necessary beforehand. Graphics.CopyTexture only additionally copies CPU data if both the src and dst textures are Read/Write enabled, with some additional restrictions:
    In this case specifically, when the format is compressed, region-only CPU copies via Graphics.CopyTexture are not supported by Unity at this time due to complexity. This would be a feature request, not a bugfix. This can be worked around if the format is not compressed, if the entire mip is copied via the appropriate overload, or if the data is separately copied to the CPU via the alternate function GetPixels, which is meant for that purpose.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.