Search Unity

Unity has UDIM support now?

Discussion in 'General Graphics' started by PhoenixAdvanced, Feb 22, 2020.

  1. PhoenixAdvanced

    PhoenixAdvanced

    Joined:
    Sep 30, 2016
    Posts:
    316
    In previous versions of unity, I was unable to get UDIM textures working properly.

    However, I recently tried this in unity 2019.3, and it seemed to work!

    I create a single model in 3ds Max, split it up into 8 groups (by assigning ID's), and then unwrapped it, placing each of the ID sections on a different UV tile.

    I then exported to substance painter, and selected the UDIM option, then textured the model in the usual way.

    After exporting to unity, my 3d shape file had 8 texture slots, which was the same as the result that I got the last time, in 2018. This time, however, when I assigned my 8 unique materials, every one of them showed up perfectly!

    So, I basically have 8 unique materials and textures assigned to one 3D object, using UDIM.

    I am not using the unity multimaterial github package that I saw online, this is just "stock" unity.

    Did I miss something in the release notes? Does unity support UDIM now?

    Based on my tests, it seems like it does!
     
    Creativepintu and gabrielmukobi like this.
  2. Toby31

    Toby31

    Joined:
    Jul 7, 2014
    Posts:
    70
    Hi Phoenix,

    Did you manage to get any clarity on this? Substance in there new update has improved the UDIM support.
    When you mention " 8 unique materials" are you saying you have 8 separate Unity standard materials for one model? (wouldn't this cause 8 draw calls for that model. being costly in game.)
    Or just one material with 8 different texture slots?
    Just would like clarity on as I would like to improve my workflow.
    I'm quite new to this process and there doesn't seem to be much information on UDIM use in Unity.
    I tried to do this years ago and applied separate materials in modelling package to different parts of the model then imported into Unity which had the same effect as it sounds like you are describing.
     
    _slash_ and soleron like this.
  3. PhoenixAdvanced

    PhoenixAdvanced

    Joined:
    Sep 30, 2016
    Posts:
    316
    Hi,

    I didn't manage to get any official clarity, but I can confirm that the new Substance version works great in unity with UDIM! It is possible to paint across seams now, which is fantastic, and that all works inside unity. You can basically have one huge object with many textures, and you can paint details across all texture sets at once, which is a very, very cool feature!

    I did need to make some changes to the export settings in substance painter to append the name of each texture set (1001, 1002, etc) to the textures, but that wasn't difficult.

    This is my material set up:

    https://imgur.com/y8r1HnT

    I am using a mesh renderer with a separate slot for each material, so yes, I am using 8 separate materials. That will cause 8 draw calls for that mode, and that would be costly in game, but as far as I am aware, there isn't another way of doing this, if there is, I'd love to hear it!

    For my purposes, I just want one UDIM object on screen at once, so having 8 draw calls isn't an issue.

    It certainly works though, it's strange that Unity haven't announced official support, it's a very useful feature when it's used correctly.
     
    Toby31 likes this.
  4. DimitriX89

    DimitriX89

    Joined:
    Jun 3, 2015
    Posts:
    551
    No, I think it doesnt. The difference here is that you applied 8 materials on a mesh, while the point of UDIM is to operate multiple textures from within a single material, AFAIK. Putting parts of the model into different UV regions was a non-factor in your case, since textures (by default) are set to repeat themselves outside UV 0-1 boundary; and you'd get the same result if all parts shared the same UV space, but had an unique material assigned to each.

    Speaking of that, I assume it would be elementary to implement UDIM effect in a custom shader. If Unity doesnt clamp the mesh UV coordinates' values to 0-1 space (which I assume it doesnt), then you can make your shader calculate UDIM index for each area of the mesh using simple math (basically rounding the U value down to integer + incrementing the UDIM V index by one after UDIM U reached a certain threshold), and apply multiple textures based on this data. Though Unity shaders can only have limited number of texture inputs I assume, so it will be limited to fixed number of UDIM rows/columns
     
    Radivarig, _slash_, sh_code and 3 others like this.
  5. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,493
    What's UDIM technically? A format to pack different texture together so we have a single reference? Basically an atlas?
     
    KRGraphics likes this.
  6. PhoenixAdvanced

    PhoenixAdvanced

    Joined:
    Sep 30, 2016
    Posts:
    316
    That's interesting.
    That's interesting. So, if UDIM was working, I would have ONE unity material, and multiple textures on the hard disk?

    The reason why I thought UDIM was working is because previously I couldn't get multiple textures to map to a single object properly in unity when I exported them outside the 0-1 number range, they all appeared on top of each other.

    Now, putting parts of the model into different UV regions works, although I need to use several materials.

    How would I have achieved this using the same UV space? If I have, for example, one object in my modelling tool, split up into different UV sets, but occupying the same UV space, won't the UV sets overlap?

    I will try it again, but I'm pretty sure I did this and it didn't work.
     
    sh_code likes this.
  7. DimitriX89

    DimitriX89

    Joined:
    Jun 3, 2015
    Posts:
    551
    Yes, one unity material, which would require special UDIM shader, with multiple texture slots (for each position on UDIM grid)
    If you have multiple materials, each containing a unique set of textures, and each is assigned to its corresponding fragment of the mesh with appropriate UVs, they'll have nothing to overlap with.
     
    Last edited: Aug 26, 2020
    sh_code, PhoenixAdvanced and soleron like this.
  8. DimitriX89

    DimitriX89

    Joined:
    Jun 3, 2015
    Posts:
    551

    Here is some demonstration. UV overlapping or not doesnt really matter if you have 2 different materials on the mesh + no UDIM support (like in Blender)
     
    sh_code likes this.
  9. Cam_Crichton

    Cam_Crichton

    Joined:
    Oct 31, 2019
    Posts:
    11
    You shouldn't need multiple texture slots - that's the whole point of UDIM, it follows a naming convention that applies the texture based on the UV space.
     
  10. DimitriX89

    DimitriX89

    Joined:
    Jun 3, 2015
    Posts:
    551
    I was speaking from Unity shader writing perspective. A shader can only have pre-determined number of texture slots. As far as I know, you cannot tell it to load textures from a folder instead of having fixed texture reference
     
  11. soleron

    soleron

    Joined:
    Apr 21, 2013
    Posts:
    582
    UDIM comes with a file that specifies which texture matches to what UV tile. So you only need to load that UDIM "configuration file".

    The other option (which kind of sucks and is not real UDIM but say, a "compatibility mode" ) is getting Substance to split the UV tiles. In which case you end up with several different materials, the amount of which depends on the amount of your UV tiles.
     
  12. Rensoburro_Taki

    Rensoburro_Taki

    Joined:
    Sep 2, 2011
    Posts:
    274
  13. PhoenixAdvanced

    PhoenixAdvanced

    Joined:
    Sep 30, 2016
    Posts:
    316
  14. miracletechteam1

    miracletechteam1

    Joined:
    Sep 18, 2019
    Posts:
    24
  15. tenchinu

    tenchinu

    Joined:
    Nov 28, 2021
    Posts:
    1
    Sorry... I'm a super n00b in Unity. Has anyone gotten a good answer on how to use UDIMs?
    I tried installing the multi-material plug-in... but, don't know why, it doesn't work.
    I'm using Unity 2019.4.31f1 if that could be the problem.
    Any other solution in how to use UDIMs?
     
    PhoenixAdvanced likes this.
  16. Toby31

    Toby31

    Joined:
    Jul 7, 2014
    Posts:
    70
    I have not looked into this for a while as the way people are describing seems redundant to me with the Unity method, other than being able to paint over seams. Which is good and use more space for your UV, the way everyone describes it from my understanding can be done with just applying multiple materials in the same 0 - 1 uv space. Only bonus is you can paint over seams. My main interest in this method was to conserve materials improving performance but having better quality textures by using more uv space. Which I don't think Unity currently does. I'm not sure if a custom shader will need to be developed or any of the ones posted above work?
     
    KRGraphics and PhoenixAdvanced like this.
  17. KingKadriK

    KingKadriK

    Joined:
    Jul 1, 2015
    Posts:
    15
    so ? UDIM work or not in Unity ??
     
  18. DimitriX89

    DimitriX89

    Joined:
    Jun 3, 2015
    Posts:
    551
    No
     
  19. Rensoburro_Taki

    Rensoburro_Taki

    Joined:
    Sep 2, 2011
    Posts:
    274
    shame on unity - again! because I just checked if Unreal supports UDIM. is of course supported -,-
     
  20. officehegias

    officehegias

    Joined:
    Feb 24, 2021
    Posts:
    1
    There was once Texture 2 from Amplify that did support UDIMs and "MegaTextures". (Their page is still online)
    It was super easy to use and just worked...

    Maybe we can get Ampifly to update it and make it work with the new versions and at least in HDRP.
     
    Radivarig likes this.
  21. Mori_X

    Mori_X

    Joined:
    Mar 17, 2023
    Posts:
    26
    Any news about any UDIM solution for unity?
     
    Last edited: Dec 3, 2023
    Radivarig likes this.
  22. Da_Drood

    Da_Drood

    Joined:
    Mar 30, 2021
    Posts:
    4
    Seriously? Please don't tell me Unity have not yet a solution for UDIM in 2024...-.-
     
  23. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,792
    They're too busy spending incredible amounts of effort doing sideways moves features wise while letting bugs pile up.

    If they ever add it, I think we're at least a year or two away.