Announcement

Collapse
No announcement yet.

Correct way to UV map models?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Correct way to UV map models?

    Hi!
    I'm getting used to the UE4 and Blender and I have a question.

    Somewhere I read that when UV mapping 3d models, I should use any part of the texture only once. The explanation is that when building the lightmap, the shadows get painted on the texture and it can make graphical glitches of shadows at wrong places.
    I've tried to ignore this rule and everything worked out well, all the shadows seem to work well after building the lightmap.

    - Should I obey this rule anyway or it's not true?

    - Is there anything alse I should keep in mind when creating models for UE?


    Thank you in advance for any answers.

    Click image for larger version

Name:	Bez-názvu.png
Views:	71
Size:	451.4 KB
ID:	1737360

    #2
    Your model can have multiple UV channels that have different sets of coordinates for the textures, you would want your material to use the first UV channel and that one can overlap like you have it there just fine. For lightmaps it can't overlap because each part of the mesh needs unique lighting and it wouldn't be able to do that if things overlap. So for the lightmaps it uses an additional UV channel where everything is mapped so that they aren't overlapping and that it stays within the 0-1 UV space (so that it's not tiling the lightmap texture)
    By default, when you import your mesh into UE4 it will try to automatically create a UV channel for the lightmap. So what happened with you is that it's working correctly because that setting is on and it did it for you.
    However, it is best to make the UV's for your lightmap yourself rather than trying to depend on an automatic method because they don't do a good job, for example the method that UE4 uses is to copy the existing UV's to a new channel and then it uses an algorithm that uses existing UV seams to flatten each piece and space them--the issue there is that if you haven't created good UV seams then it won't work because it won't create UV seams automatically.
    There are some other automatic UV mapping tools that will split things by angles and that can still produce some problems since it can end up with a lot of pieces where the UV space is not optimized.

    So to summarize:
    -You need a second UV channel for lightmaps where things aren't overlapping and they stay in the 0-1 UV space
    -Making the lightmap UV's yourself can get better lightmap results, automatic methods (like the one UE4 uses) don't do a good job, if the automatic method looks OK then leave it and don't bother doing it manually, but it could possibly turn out better or in a way that allows you to use a lower resolution lightmap if you do it yourself.
    -If you make your own, make sure to turn off the Generate Automatic Lightmap UV's in the import settings in UE4. With that turned off it will assume that the second channel is the lightmap channel and set it to use that for the lightmap.
    -First channel (0) should be for your material, the second channel for your lightmap.

    Comment


      #3
      Thank you for your explanation! That's very interesting, I'll try to keep it in my mind and work with it.

      Is there somewhere a knowledge base "how things work"? Feels like most of the "Google answers" are "how to do it" rather than "how it works".

      Comment


        #4
        Lets say you model a coin, you would see only one face on the coin when looking at it so the other face could use the same UV without much problems. But the 2 faces would have the same textures. Now for a wall like you did you should use the whole space. I suggest blender guru if you want to learn:

        https://www.youtube.com/watch?v=scPSP_U858k

        This is for older blender versions but it's still very useful.

        Base: you must mark the seam of any hard edge (angle 90° or more)
        Islands must have a margin between them. Look the link at 1;31 there is a space between faces with hard edges. The anvil after same thing.
        You must use the whole UV space or it would be a waste.
        Last edited by Jeel_884; 03-27-2020, 06:45 AM.

        Comment


          #5
          Thank you!
          I think I understand the basic ideas behind the UV mapping but I guess it's never late to see it all in one place like in the video.

          Comment

          Working...
          X