Search Unity

UV Editor - Resizing the texture?

Discussion in 'World Building' started by ptgodz, Dec 6, 2018.

  1. ptgodz

    ptgodz

    Joined:
    Aug 4, 2016
    Posts:
    106
    Hey guys. I'm starting out with probuilder and I'm struggling to understand the UV side of it. When I try to export my UVs nothing seems to be visible unless I shrink them all to fit in the little box. I don't know what to actually call it. Texture viewport? I've attached an image of what I'm on about. I'm assumning that all UVs I want to export must be within this area. Is it possible to enlarge the size of this area? Thanks
    uveditor.png
     
  2. gabrielw_unity

    gabrielw_unity

    Unity Technologies

    Joined:
    Feb 19, 2018
    Posts:
    963
    Hi! Yep, UVs are...well, for me, they took a few months to learn, then they "clicked" :)

    Basically, only that little box matters, and everything else is just repeating (or, "tiling", as it's called here). UVs can go outside the box, but they'll just get mapped to their "tiled" position. Here's an easy way to think of this: the UV box is 0 to 1, on both axis. So a pixel in your texture is always at something between 0 and 1 (far left/bottom or far right/top). If you move UVs outside of the box, to something like 12.75, the whole number just gets chopped off- so that becomes .75 instead of 12.75.

    The good news is- that little box is actually an infinite sized box. Zoom in and fit all your UVs in, there, you'll never lose quality (other than your texture resolution).

    Hope that helps!
     
    ptgodz likes this.
  3. ptgodz

    ptgodz

    Joined:
    Aug 4, 2016
    Posts:
    106
    Thanks for replying to me Gabriel. This makes sense now. The tiling is almost like a resolution in some ways, but tiled.

    This has got me thinking however. If I was to have my texture file and say I have a small brick on that texture. Is it possible for me to map that specific area of the texture to an area of my UV map and tile it? I've attached another example of what I'm trying to say.

    uv example.jpg

    If this isn't possible, is there a typical way that people lay out their texture maps? in order to accomplish this.

    With the example above, Some of the unselected UVs are long walls roughly 2m x 10m unity units in size. I was looking to texture these by using a smaller section of my texture map designed for a 2 x 1 size and then repeat it. However it appears that this would probably need to be a entirely separate texture if the example above isn't possible. This is absolutely fine. I just want to make sure I'm not missing something.
     
  4. gabrielw_unity

    gabrielw_unity

    Unity Technologies

    Joined:
    Feb 19, 2018
    Posts:
    963
    Hi! Yep, unfortunately it isn't possible to tile just a portion of the texture...other than using something like sliced sprites, which works for UI but isn't really useful for level/game geometry, in general.

    So, you'll need to create a separate texture file and material for each thing you want to tile. Or, layout everything in that box and manually paint in the textures...but that usually means you are limited to 4096 or lower, depending on performance stuff. Tiling lets you get away with low-res textures, repeating across the geometry :)
     
  5. gabrielw_unity

    gabrielw_unity

    Unity Technologies

    Joined:
    Feb 19, 2018
    Posts:
    963
    Also, don't forget that you can apply as many materials as you like to a PB object, just select the face(s) and apply as needed :)
     
  6. ptgodz

    ptgodz

    Joined:
    Aug 4, 2016
    Posts:
    106
    This has been really helpful. I'm gonna go learn the key shortcuts and give this ago.

    I also had no idea that I could add multiple materials to PB objects so this is something I'm going to take a look at.

    Thanks again!
     
  7. gabrielw_unity

    gabrielw_unity

    Unity Technologies

    Joined:
    Feb 19, 2018
    Posts:
    963
  8. Realgar

    Realgar

    Joined:
    Sep 30, 2012
    Posts:
    52
    Hi, when I look at mesh analyser, I just have less than 3 % of my texture used by my uv mapping... It's why I have a low resolution when I see the material and when I paint on it when I am in game... Do you know a 3D tool I could use to maximise the use of the texture in my UV map ? Perhaps it's a silly question. I tried to reset UV in blender and recreate them with Auto lightmaps in Unity, but it's not better. I have about 21 meshes that compose a big cave. Each section should use the maximum of the 4K texture to keep a good resolution... Thank's if you can help me !
     
  9. arfish

    arfish

    Joined:
    Jan 28, 2017
    Posts:
    782
    Hi, not necessarily I guess. Perhaps other meshes are using the same texture, just other parts of it.

    (And don't necropost four years old threads. Start a new one.)