Search Unity

  1. Unity 2020 LTS & Unity 2021.1 have been released.
    Dismiss Notice

Graphics.CopyTexture to Texture2DArray no longer working

Discussion in '2018.3 Beta' started by andywatts, Oct 29, 2018.

  1. andywatts

    andywatts

    Joined:
    Sep 19, 2015
    Posts:
    92
    I'm using Graphics.CopyTexture to load a Texture2D into a Texture2DArray.

    Both the texture and textureArray are DXT5 format.

    This gist shows it working fine in 2017.2.

    In 2018.3 two errors are thrown. "Invalid texture format: 12" and "Image invalid format!".

    Anyone have any ideas?
     
    Last edited: Oct 29, 2018
  2. andywatts

    andywatts

    Joined:
    Sep 19, 2015
    Posts:
    92
  3. Hyp-X

    Hyp-X

    Joined:
    Jun 24, 2015
    Posts:
    389
    Getting these errors with DXT1 and BC5:
    Invalid texture format: 10
    Invalid texture format: 27
     
  4. iamarugin

    iamarugin

    Joined:
    Dec 17, 2014
    Posts:
    634
    It will be very annoying if this bug ends up in the final release.
     
  5. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,161
    poking some devs...
     
    ibbybn, transat, PixelMind and 2 others like this.
  6. iamarugin

    iamarugin

    Joined:
    Dec 17, 2014
    Posts:
    634
    Great news, thanks
     
  7. transat

    transat

    Joined:
    May 5, 2018
    Posts:
    772
    I'm also keen to see this fixed.
     
  8. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    4,752
    Any word on this? I get at least one bug report a day about it because my assets use texture arrays..
     
  9. transat

    transat

    Joined:
    May 5, 2018
    Posts:
    772
    @Tim-C Could you poke some more for us? :)
     
  10. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    4,752
    Doesn't look like it's fixed in Beta10 either.
     
  11. transat

    transat

    Joined:
    May 5, 2018
    Posts:
    772
    Issue now seems to have been fixed. I presume we'll be good to go from 2018.3b11.
     
  12. rz_0lento

    rz_0lento

    Joined:
    Oct 8, 2013
    Posts:
    1,983
    issue tracker says "Fixed in Unity 2019.1" though..
     
  13. transat

    transat

    Joined:
    May 5, 2018
    Posts:
    772
    @rizu A bit confusing but I'm pretty sure it should still make its way back to 2018.3. I think Unity just writes down the first version to include the fix.
     
  14. rz_0lento

    rz_0lento

    Joined:
    Oct 8, 2013
    Posts:
    1,983
    it's possible sure, I just wouldn't take it granted until any official note on it :)

    but we'll see soon enough..
     
  15. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    2,477
    We're working on getting this fix to 2018.3.
     
    transat, tduriga, jbooth and 2 others like this.
  16. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    4,752
    Was in the b12 release notes as fixed, still broken..

    Graphics.CopyTexture with a region will not copy readable texture data for compressed formats (source texture format 12)
    UnityEngine.Graphics:CopyTexture(Texture, Int32, Int32, Texture, Int32, Int32)
    JBooth.MicroSplat.MicroSplatUtilities:DrawTextureSelector(Int32, Texture2DArray, Boolean) (at Assets/MicroSplat/Core/Scripts/Editor/MicroSplatUtilities.cs:190)
    MicroSplatShaderGUI:OnGUI(MaterialEditor, MaterialProperty[]) (at Assets/MicroSplat/Core/Scripts/Editor/MicroSplatShaderGUI.cs:184)
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)
     
  17. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    2,477
    Yes, there was more than one issue. The complete fix will be in the next release.
    https://issuetracker.unity3d.com/is...e-not-working-for-compressed-textures-anymore
     
unityunity