Home Technical Talk

Combining UV's with different objects

So my question is on if this is doable. But What I need to do Is combine the UV's of 2 different objects. Meaning that at the end they will share the same UV map and a single texture will be good for both of them. I have 2 models that each have there own UV set ups they also both have great looking texture, normal, and specular maps, which I do not want to re-bake or redo. Is there some way that I could simultaneously move the UV location as well as the actual picture areas in the 3 maps.

Yes I know I can move pictures in Photoshop but I need a quicker way.

Replies

  • passerby
    Options
    Offline / Send Message
    passerby polycounter lvl 12
    Don't need to do anything special, just make sure both objects are referencing the same texture, and that they both are mapped to the correct part of the texture.
  • VisceralD
    Options
    Offline / Send Message
    passerby wrote: »
    Don't need to do anything special, just make sure both objects are referencing the same texture, and that they both are mapped to the correct part of the texture.

    That's not really helping me, How will I move the locations of the texture maps I already have to match the new UV locations.
  • Eric Chadwick
    Options
    Offline / Send Message
    You can use a baking tool to do this, like Render To Texture in 3ds Max.

    You should create a new UV channel (UV 2 for example) that contains both objects. Then bake each map from UV1 into UV2.

    Baking the normal map is more difficult, because UV rotations will require different gradients. Best thing is to re-bake from the high-res models.
  • VisceralD
    Options
    Offline / Send Message
    Thats kind of an issue with me because I first lost the high poly, This is me fixing up a project I did a while ago. Second objects overlap so bakes might not be very good. Again everything has a already good texture map and bump map. I mean I know I could do this by moving the UV's on the same map, then Photoshopping the various maps together but that will take too long. If there is no tool that does something like this then I think there should be.
  • VisceralD
    Options
    Offline / Send Message
    Also in my situation it might be a better Idea to apply the already made normal maps as a diffuse and merge them that way
  • Eric Chadwick
    Options
    Offline / Send Message
    There is a tool for this, as I mentioned. It works great for most maps. However, normal maps are quite different. The colors of a normal map are specific to the directions the polygons are facing and the rotations of the UVs. You can't just rotate them in Photoshop, without doing some careful adjustments. Some explanation here about why this is so... http://wiki.polycount.com/NormalMap#TB
  • Eric Chadwick
    Options
    Offline / Send Message
    Baking from one UV to another completely avoids geometry overlap problems, because you're baking from/to copies of the same geo, just different UVs.

    You need to apply the normal map as a normal map, making the UV 1 model look like it's a high poly model.
  • passerby
    Options
    Offline / Send Message
    passerby polycounter lvl 12
    Ya just bake from one UV set to a other like Eric, said, problem is the normals the only way that will work 100% for that would be rebakeing them.
  • HarlequiN
    Options
    Offline / Send Message
    HarlequiN polycounter lvl 18
    If you need to re-bake the normals you could try using the original normal maps as, well, normal maps, and then baking new normals from that as though the low poly (with normal maps) is a high poly. The re-baking should give you the correct normals in the new result because it's baking from normal information, not diffuse colours.

    I've never tried it in the case of re-baking, but I've used normal maps on high poly meshes to add additional detail in the past, and it baked into the final normal map texture just as if I'd used geometry there. Might be worth a try.

    Failing that, if you keep the orientation and shapes of the UV Islands the same and just rescale and move them then the normals should still work if baked directly.

    As Eric and passerby have said, baking the other maps should be just a 1 to 1 on the UV's, occluding or intersecting geometry shouldn't make a difference to the bake (it will make a difference when re-baking the normals though).
  • Eric Chadwick
    Options
    Offline / Send Message
    Hey Harl is back!


    You may get random pixels in the normal map bake, at least I did when I did this. If so here are a couple solutions, plus an example pic...
    http://wiki.polycount.net/NormalMap#Solving_Pixel_Artifacts
  • HarlequiN
    Options
    Offline / Send Message
    HarlequiN polycounter lvl 18
    Good point. That's one reason I'd recommend treating it like any High to Low bake, including a pushed cage. I sort of touched on that, but wasn't terribly clear, so thank you Eric :)

    I'm not really "back" so much as popping in. I am going to make an effort to pop in more often though, since the last time was almost 5 years ago (eek).
  • Eric Chadwick
    Options
    Offline / Send Message
    Actually no, it's not a pushed cage, I had to push the mesh itself. *shrug* Almost like it was trying to render itself as well as the target. Or something.
  • HarlequiN
    Options
    Offline / Send Message
    HarlequiN polycounter lvl 18
    That... Actually makes sense. Well. you've tested out the theory already, which is more than I've done :)

    VisceralD, what Eric said.
  • slosh
    Options
    Offline / Send Message
    slosh hero character
    I think you're hosed if ur highpoly is gone. Just move the pieces in photoshop with smartobjects so you only have to do it with one map but don't rotate your shells.
  • Bek
    Options
    Offline / Send Message
    Bek interpolator
    I've got a lazier way.

    Just combined the two (what I assume are square) textures side by side into a new 2:1 texture. Offset the UV's of the model to the left texture by 1, scale all by 50%, move right by 0.5... done. Don't have to rebake anything, can still use source .psd's by textures... but only if your engine supports 2:1
  • VisceralD
    Options
    Offline / Send Message
    Eric your right, but baking is not perfect and things can get messed up if the cage of one object intersects the area of another object. Slosh, Bek that's a great way of thinking outside of the box. Wait slosh how can I move multiple layers at the same time with smart objects.
  • Noors
    Options
    Offline / Send Message
    Noors greentooth
    I wonder if you still have those artefacts when putting source object visibility at 0. Didn't try it, but it fixes the same kind of issue with MR AO.
  • VisceralD
    Options
    Offline / Send Message
    Why turn visibility to zero, when you can just hide the object.
  • Eric Chadwick
    Options
    Offline / Send Message
    It has to be renderable, in some fashion.

    The offset trick is a good one though, no UV fiddling, no rebaking. Much better! Rebaking maps is a bit of a lossy operation, re-rendering will filter your maps, adding some blurriness. Also the offset keeps all your layers intact!
  • VisceralD
    Options
    Offline / Send Message
    Well my end goal is for this to work in a game engine, I don't think UE4 accepts offset UV maps
  • Bek
    Options
    Offline / Send Message
    Bek interpolator
    Nothing is offset, your UV's will all be within the 0-1 range. They'll just be squashed by 50% to match the 2:1 texture. Nothing engine specific at all. If it's still not clear I'll upload a quick example.

    edit: this is what I mean

    mEi1azV.gif


    If your original textures are both 2:1 you could combine to one square UV (assuming they're the same resolution). If they're some odd combination then you'll have some wasted space that another asset could possibly use, but that's still a bit fiddly.
Sign In or Register to comment.