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

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:
    112
    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:
    112
  3. Hyp-X

    Hyp-X

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

    iamarugin

    Joined:
    Dec 17, 2014
    Posts:
    883
    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,225
    poking some devs...
     
    ibbybn, transat, PixelMind and 2 others like this.
  6. iamarugin

    iamarugin

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

    transat

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

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,461
    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:
    779
    @Tim-C Could you poke some more for us? :)
     
  10. jbooth

    jbooth

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

    transat

    Joined:
    May 5, 2018
    Posts:
    779
    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:
    2,361
    issue tracker says "Fixed in Unity 2019.1" though..
     
  13. transat

    transat

    Joined:
    May 5, 2018
    Posts:
    779
    @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:
    2,361
    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:
    3,136
    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:
    5,461
    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:
    3,136
    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