Home Technical Talk

UV Shell Too Large To Fit In UV Map!

Oliverr
polycounter lvl 7
Offline / Send Message
Oliverr polycounter lvl 7

I'm making a simple modular road asset that will be used with the UE5 spline tool to make a highway in my scene. However it is giving me some problems when it comes to UV mapping. I'm trying to maintain a 5.12 px/cm texel density throughout my entire scene, but doing so with this asset gives me UV Shells that are larger than the UV map. I can't just slap on a tiling material (as far as I know) because I need to add details in Substance Painter. Also splitting something like this up into multiple maps seems wrong. Help is much appreciated!

My UVs and Model:

Something similar to what I'm trying to achieve:


Replies

  • Kanni3d
    Offline / Send Message
    Kanni3d ngon master

    If you are trying to maintain a certain texel density and not use tiling materials, then you are stuck with either:

    • splitting the geometry to get some symmetrical/overlapping UVs to fit it in your UV space.
    • Use a higher texture resolution (which will then of course leave a ton of unused space)
  • Joopson
    Online / Send Message
    Joopson Polycount Sponsor

    Frankly, in this sort of case, I'd just scale down the UVs to fit. Unless there's a client demanding it be exactly 5.12px/cm, which I personally think would be a weird demand, considering it'll look just fine even if scaled down that little bit.

  • Fabi_G
    Offline / Send Message
    Fabi_G sublime tool

    You could combine a road mesh using tiling material with mesh decals for strips and markings.

  • Oliverr
    Offline / Send Message
    Oliverr polycounter lvl 7

    Yeah I think scaling down is my best/only option. However, I am curious how would be the right way to approach something like this if I did need to maintain a specific texel density. Would the only way be using a tiling asphalt material over the entire model, then use decals or something for the road lines, cracks, and dirt?

  • Fabi_G
    Offline / Send Message
    Fabi_G sublime tool

    Roads in Matrix demo: https://youtu.be/xLVJP-o0g28?t=2531 Maybe you can extract some things for your project.

  • Oliverr
    Offline / Send Message
    Oliverr polycounter lvl 7

    I'm not against using tiling materials to maintain texel density, I'm just unsure how I would go about doing that while still having the street lines, cracks, and dirt in the correct places. Splitting the geometry and stacking UVs seems like it'll create the problems that I'm trying to avoid by not using a tiling material (not being able to add detail in a specific area because it would duplicate somewhere else on the model). Also using a higher texture resolution would leave a ton of unused space like you mentioned. However, maybe I could squeeze some other props in the empty space and make that texture set multi-purpose? I'm still learning so I have no clue what the correct approach should be. I appreciate the advice!

  • Oliverr
    Offline / Send Message
    Oliverr polycounter lvl 7

    Wow, the way they did the roads in the demo is crazy! Their method seems a little too complex for this specific project but It's definitely something I could look back to if I start a project that's more complex. The tiling material + decals does seem like a proper solution for this but I have no experience with that so I'm going to look into some tutorials. I would love to be able to do everything in Painter and just have to drop the assets into UE5, but if the decals are only possible by doing them in engine then I might give that a shot.

  • Kanni3d
    Offline / Send Message
    Kanni3d ngon master

    Sure, but if you are worried of certain details and placements, you'll have to explore other methods since clearly using a unique material is posing some issues. You most definitely should be handling this with tiling, decals, and trims (since it's such a large asset).

  • Oliverr
    Offline / Send Message
    Oliverr polycounter lvl 7

    If using tiling materials with decals and trims is the proper way then I'm definitely going to explore that route. All decal work is done in engine and not in Painter right?

  • Kanni3d
    Offline / Send Message
    Kanni3d ngon master

    Correct, yeah. Placements and "design" of them are done in engine/renderer.

  • gnoop
    Offline / Send Message
    gnoop polycounter

    From the video it looks like they use UV shift and shuffle and probably rotating within a kind of macro UV islands. Dos anyone know how they deal with islands edge seams that would indeed appear under so severe UV deformation ?

  • Oliverr
    Offline / Send Message
    Oliverr polycounter lvl 7

    UPDATE:

    I was able to make a basic material in painter for the road with enough wiggle room before UVs overlapped to make track/tire marks. After that I used decals from quixel bridge for cracks and road markings. However, I'm having a hard time getting the cracks looking realistic without placing a million decals. I'm using a reference for the cracks and I'm just not able to get it right. Is there another way to approach this?

    Current Project:

    Reference I'm using for the cracks/wear:


  • rexo12
    Offline / Send Message
    rexo12 greentooth

    This should be done in shader with some tileables rather than decals, otherwise you are going to have to hand-place a million (and blow out your draw calls/overdraw too)! Overlay the texture onto your trim using world-space coordinates or something similar.

  • Fabi_G
    Offline / Send Message
    Fabi_G sublime tool

    Yes, a cracks layer in the material sound like a simple solution, you could control intensity by a macro noise.

    Regarding markings on the road, I'd include them into the module to avoid having to place them manually (unless your spline tool does that ofc).

    If this is for the gas station environment you are working on, I'm not sure if splitting your focus across so many different (and new?) subjects is going to help you. Maybe keep the environment bare bones at first (simple ground mesh + sky sphere) and focus on the gas station subject? But hey, to each its own, as long your having fun :) Assuming your recent threads (sign, road, landscape) relate to the same environment, it might be better to contain all in one thread for future project, to provide more context.

  • Tiles
    Offline / Send Message
    Tiles greentooth

    I would try to go with a splatting shader and an alpha channeled dirtmap for the cracks, and tile it over the whole road. One draw call. Mabe two of the dirtmaps, different patterned and different scaled. This gives you the needed variations. Maybe this can even be done procedural in the shader. But i guess this would eat too much performance. Textures are faster.

  • poopipe
    Offline / Send Message
    poopipe veteran polycounter

    Draw calls, cost of using decals etc are irrelevant here because virtual textures exist.

  • Oliverr
    Offline / Send Message
    Oliverr polycounter lvl 7

    For a "crack layer in the material" do you mean adding the cracks directly to the material I created in Substance Painter? Or is the crack layer something I do in UE5. A lot of the advice I'm getting in this thread regarding the cracks is completely foreign to me and I'm not really sure what any of it means lol. I'm having a lot of fun learning everything though!

    The markings on the road I just did by hand with decals from quixel bridge and it looks fine. The only issue is that if I were to add the cracks directly into the material, then the decals would cover the cracks and I wouldn't be able to have cracks running through the road markings. Maybe that's something including in it in the "module" would fix, but again this is all new to me so I'm not sure what exactly that means.

    And yes, its all the same gas station project. I downloaded UE5 after making the sign to try to get a basic scene set up for a block out, but as you can tell I got really carried away with the road and the landscape (which in my head was going to be super easy). But I don't mind, I'm having fun learning all this stuff. Once I have all this all figured out I'll get back on track with the actual gas station. Also, I'm going to start a new thread for the project and keep everything in there. That's probably what I should have done from the start.

    I really appreciate you offering so much advice and feedback on my threads!

  • Oliverr
    Offline / Send Message
    Oliverr polycounter lvl 7

    Do you know of a video reference for how this is done? I'm really new to Unreal Engine and I don't think I've ever worked with shaders before so idk where to start.

  • Oliverr
    Offline / Send Message
    Oliverr polycounter lvl 7

    Thank you! Looked up "splatter shader" online and it seems like it could actually be what I'm looking for. Just skimmed through a tutorial and it was being used on a landscape, not a mesh like my road. I feel like once I have sometime to watch it through, I can figure out how to apply it to my road material. Hopefully this is the solution to my problem.

  • rexo12
    Offline / Send Message
    rexo12 greentooth

    I'm not a big user of video tuts so nothing i can personally vouch for, I expect a query on "World Space Texture Coordinates UE4" will net good results.

    The Unreal docs have some examples, look at the WorldPosition section. Given that you haven't worked with shaders, it might be better to start from first principles:

    and the Unreal engine documentation is always a (generally okay) reference:

    https://docs.unrealengine.com/4.27/en-US/RenderingAndGraphics/Materials/

  • Oliverr
    Offline / Send Message
    Oliverr polycounter lvl 7

    UPDATE:

    I was having a hard time trying to figure out how to do the suggestions after my last post so I just went ahead and hand drew the cracks in Substance Painter. Definitely not the perfect solution for a variety of reasons so I will be coming back to it at some point. Additional advice would be extremely appreciated, however I am going to begin tackling the rest of this environment since this road has taken so much more of my time than intended. Will be making a separate thread for that soon if interested. Here are some screenshots of my current project and my problems with the solution I just tried.

    Cracks are looking how I want since I did them by hand (mostly cracking parallel to the road like my reference):

    Tiling is way too noticeable:

    Road marking decals cover the cracks (instead of cutting through the paint):


  • Tiles
    Offline / Send Message
    Tiles greentooth

    What would be wrong with putting the stripes onto the roadmesh too, and not by decal? Here we would be back at texture layering :)

    Decals are great for several things. But not so great for others as you just find out. Shadows is also such a trouble maker as i remember ...

    Also, when it's a modular system, what about let's say minimum three variations of the modules? This way you can overcome the repititive look to some degree. Maybe playing around with a trimsheet here too, to allow even more variations. Or different mapping, dependant of X Y position in the world.

    I am unfortunately too long out of game business to give more detailed advice. I don't know what shaders and possibilities exists nowadays. The last time i had Unity open was 2015.

  • Ghogiel
    Offline / Send Message
    Ghogiel greentooth

    being uniquely textured so tiling is unavoidable. The easiest and probably cheapest solution to address the tiling issue, that would also piggy back on what you have done so far is probably make an alternative texture variation and use vertex paint to blend it in here and there, with a mask inbetween the blend it might look decent enough of a transistion and should give you enough of a break up of the tiling

  • Fabi_G
    Offline / Send Message
    Fabi_G sublime tool

    Hey! I would add the cracks layer inside of the material in Unreal. There are plenty of material expressions and functions you can use to combine different textures in the material (like linear interpolate, multiply, blend angle corrected normal, ...). Got to get familiar with the material system and use the documentation. There are also plenty of videos out there going over every material node like WTF is? Material.

    The decal normal map overriding the cracks, is due to the decal materials blend mode. Don't know what's the best solution here. You will just have to experiment to find the best solution for your case. Generally, best keep it simple at the beginning.

  • Oliverr
    Offline / Send Message
    Oliverr polycounter lvl 7

    HUGE UPDATE!:

    I somehow figured it all out through trial and error. I was able to use DBuffer nodes to apply a mask to decals applied to a given mesh (in my case the road mesh) to mask around the cracks. This was so tedious to figure out since I could not find any explanatory documentation online about masking decals. Although I was pulling my hair out trying to figure this out, its very satisfying knowing that I was able to get it working without any tutorials or decent documentation.

    As far as the tiling issue goes, all I have to do is make different variations of my cracking material. This should have been the obvious solution, idk why I didn't think of it right away (Thanks to those who pointed that out).

    Solution in Action:

    Material Blueprint:

    Huge thank you to everyone who offered help and advice on this thread!

  • poopipe
    Offline / Send Message
    poopipe veteran polycounter

    good find - I didn't know those dbuffer nodes existed.


    for the tiling issue - make a 2 or 3 versions of the material and use a world space mask (noise texture or something) to blend between them

    also go read about virtual textures - they're for making this sort of thing cheaper and better

  • Oliverr
    Offline / Send Message
    Oliverr polycounter lvl 7

    I've been planning on making a few versions of the material to help with tiling but I don't really know anything about blending materials using a world space masks, so that's something I will definitely look into. I have looked into virtual textures a little bit to help blend my meshes into the landscape material a bit better, but I definitely have to read up on it a bit more. Thanks for the advice!

  • poopipe
    Offline / Send Message
    poopipe veteran polycounter

    for something like this you probably want to use layered materials and custom blend thingies.. itll enable a lot more re-use of resources in terms of workflow.


    using RVT will remove any additional cost incurred by doing maths so you can treat the shader as (almost) free (not really, but most of the time - you'll work it out from the docs)

Sign In or Register to comment.