Home Unreal Engine

UDIM's in UE4

YebYebYeb
null
Hello. I have a question about UDIM's Unreal Engine 4. From what I've read UE4 does not support UDIM's. Is there a similar way to have multi grids and UE4 does it support? Can anyone know the best way to add several materials in one mesh? I will be grateful for any hint that can bring me closer to the heart of the question. In my workflow I using 3ds max, xnormal and quixel suite. If you need more information or you dont understand me ( sorry for bad english ) I will try better clarify my question.

Thanks

Replies

  • Obscura
    Offline / Send Message
    Obscura grand marshal polycounter
    Yes. Use an IF on the uv coordinates. If you are looking for tile 4 on the horizontal axis, compare it with 4. If bigger, output one. If smaller, output zero. Then you can use this to lerp together your tiles. Doing this manually isn't really effective when we are talking about large amount of tiles. But you can probably loop them in a custom node.


    There is also this plugin ?
    http://graphinesoftware.com/products/granite-for-unreal

    Can't say anything about it because I haven't tried it out. But I know the above mentioned method works nicely with small amount of tiles.
  • YebYebYeb
    I need wait for granite license.  Is there another way to achieve the same result? I give you another example, because I feel we did not understand or I do not understand your answer. There is a simple mesh with 3 UV's.




    Now i want to make 3 materials in one mesh. My intention is to have three 4k textures in one mesh. I know 3 ways:
    1. Making ID map for each UV, but the resolution will go down to 3 UV.  This way I will achieve one 4k texture.
    2. For each UV assign another ID material, so that I reach the intended purpose of the three 4k texture. Unfortunately I do not know if quixel suite supports ID material with 3ds max.
    3. Cut mesh into three parts, make UV's, group them together and export. 

    Is there another way that is better or more professional? 
  • Obscura
    Offline / Send Message
    Obscura grand marshal polycounter
    Yes there is... Use one material. Put an "if" in your material in unreal. If you are doing only horizontal udim tiles, compare the x component of the uv coordinates to the tile number that you are looking for. Lets say 2. Tile 2 starts where U (x component) is > than 1. And it finishes where U == 2. This can give you an "idmap" so you can lerp together the tiles. You'd do the same for the another tiles but with different numbers.
  • melviso
    Offline / Send Message
    melviso polycounter lvl 10
    Sometimes, I just wish UE4 had ptex support. I get why people prefer uvs but for me ptex is dope.
  • Obscura
    Offline / Send Message
    Obscura grand marshal polycounter
    melviso said:
    Sometimes, I just wish UE4 had ptex support. I get why people prefer uvs but for me ptex is dope.
     
    I was like this a few years ago :)
  • YebYebYeb
    Now i understand :) in previous answer you wrote about IF, but i didn't understand what do you mean. It's something like this? I'm not good from creating materials in UE4, because I always working in Quixel/Substance Painter. Now I want to be more professional artist, so I looking for the best way for show my work and optimize it for games.



    If I think badly can you give me an example?
  • Obscura
    Offline / Send Message
    Obscura grand marshal polycounter
    Similarly. I'll make you an example after I got home.
  • Obscura
    Offline / Send Message
    Obscura grand marshal polycounter
    Here we go... So I would not suggest to directly plug the textures into the output options of the "if"... because it will want float 1 values and your texture is a float 3 and you'd need to do a lot of magic to get everything working correctly. Instead, use the if to create your id maps... it will give you a mask that you can use in the lerp later. For good representation, I made the same mesh and uvs as you:


    During the export setup, there is nothing special, since we only talk about where are some uvs that relates to some textures. I only assigned 1 material. This can work with any amount of tiles/materials though but it gets complex when it comes to huge amount of tiles, as I mentioned. In that case, you want a custom node solution, or that plugin...
    But for a few, you do this:


    As I said, the if should be used to create the id maps based on uv locations. Then you can lerp the udim tiles to blend them. When you preview the ifs, you can see that it gives you black and white "textures" on the given uv locations, this is why it works with the lerp. Lerp is like a blend mask in PS. When you put a mask on your layer.

  • melviso
    Offline / Send Message
    melviso polycounter lvl 10
    Thanks, Obscura :)
  • YebYebYeb
    Thank you man! You are the best :)
  • k2000
    Offline / Send Message
    k2000 null
    well... got same question about UDIMs but... I have 14 of them, and looks like my mind is going to explode before I finish that complex material :#
    will go simple way of having 14 separate mesh pieces and 14 different materials ((( sad
  • Obscura
    Offline / Send Message
    Obscura grand marshal polycounter
    I'm thinking about making some functions for this, because of the bigger interest nowadays, but I will need to make multiple functions, because of performance reasons , and always the correct one should be used. Like 2x2 one if you only need 4 tiles or 3x3 if you need up to 9, and the 4x4 (up to 16 tiles) only if necessary. I'll probably provide a dummy texture that will be used on unused slots, lets say you only use 3 texture slots from the 2x2 function, then dummy texture is used on the remained tiles. It won't show on your mesh though. I also don't want to go with switches (so it won't compile all variations) this is why I'm thinking about fixed amount of textures. What do you think guys, would this work? I'd say if you use the most of the slots, its fine, but using 2 tiles from the 4x4 one would be very uneffiecient, or course.
  • Obscura
    Offline / Send Message
    Obscura grand marshal polycounter
    So I was thinking about this more and I think I could do it with a "while" statement in a custom node, with static amount of inputs, lets say max 16 tiles on a 4x4 grid but it would have "tiles" input and it would stop whenever the loop reached the amount of needed tiles. I'll come back with the results.
  • Obscura
    Offline / Send Message
    Obscura grand marshal polycounter
    After some testing I just went with the 4 separated functions, and 4x4 (16) tiles at maximum.
    Thread and download here:
    http://polycount.com/discussion/193086/udim-function-collection-and-material-templates/p1?new=1

    Have fun!
  • k2000
    Offline / Send Message
    k2000 null
    thanks, man! will give it a try :)
  • RAVX
    Offline / Send Message
    RAVX null
    @Obscura Thanks dude for this explanation <3 
Sign In or Register to comment.