Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice
  2. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  3. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Bug (Case 1262413) Graphics.CopyTexture doesn't work to copy compressed Texture2D in Texture3D

Discussion in '2020.2 Beta' started by Peter77, Jul 11, 2020.

  1. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,589
    Using Graphics.CopyTexture to copy the content of a Texture2D object in a Texture3D slice, does not work, if the Texture2D and Texture3D use a compressed texture format.

    upload_2020-7-12_9-4-8.png




    Reproduce
    • Open attached project
    • Select "New Texture3D Atlas" asset in Project window and lock its Inspector
    • In the Inspector, enable the "Slice" button and set the X=256, Y=256 and Z=1.5
    • Notice the Texture3D displays a blue gift texture and shows "256x256x3 RGBA 32 bit 0.8 MB"
    • Open another Inspector window
    • Select the "Bike", "Gift" and "House" textures and lock their Inspector
    • Switch to the "PC Standalone" tab in the Inspector
    • Choose "RGBA 64 bit" as format and press Apply
    • Notice the Texture3D still displays correctly
    • Choose "RGBA Compressed DXT5" as format and press Apply
    • Notice the Texture3D displays garbage

    Actual
    Graphics.CopyTexture does not copy correct data in depth slices other than the first one, if the source texture is using a compressed format.

    Expected
    Graphics.CopyTexture should work for compressed textures and for all slices.

    Note
    In alpha 16 this related issue was fixed.
     
    Last edited: Jul 12, 2020
  2. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,589
  3. Zapan15

    Zapan15

    Joined:
    Apr 11, 2011
    Posts:
    186
    This does not work with crunched textures.