Home Technical Talk

Interchangeable UV maps. Possible?

polycounter lvl 14
Offline / Send Message
East polycounter lvl 14
uvq.jpg

Seeing how I know next to nothing about these things I figured I would ask about them. I have this set of 1024^2px maps (diffuse, normal, spec) for a head I've been working on. It's a game asset, so it's supposed to go into a game engine at one point or another.

The character's head is supposed to be customizable with scars, tattoos, and so on, and I was thinking whether or not I could put all these customizations into the textures, and somehow dynamically change the UV map to display the different "parts". Does anyone have any experience with this in game engines generally, and knows if it would work?

If possible, would I need a whole new UV map for every detail, or would it be possible to mix things up somehow, to combine e.g. the cheek tattoo with the lip scar? Or would I have to have a separate UV map for this combination?

Lots of questions, I know, and all might depend on the engine (the Torque Game Engine Advanced). Cutting things up like this might also produce seams with the normal map, and so on. Perhaps there's a better solution for this?

Replies

  • odium
    Options
    Offline / Send Message
    odium polycounter lvl 18
    It sounds like it may be best to re-load the entire surface or just have little areas using their own UV map, hell, even the RtCW way of just having floating polygons for things may work better.
  • Rob Galanakis
    Options
    Offline / Send Message
    Try making multiple UV sets for the same surface. Each UV set can have the target polygons with different UV's.

    I'd recommend, for mixing and matching 'parts,' to separate these polygons entirely, give them a UV set for each different texture (ie, lip scar 1 has the polygon UV's in one place, lip scar 2 in another, etc).

    Gah its really hard to explain what I mean, if you don't understand just ask.

    You will get normal map seams if you are not careful, and some shaders will give you problems at the seams as well (though standard ones should be fine). But, done carefully, it should be fine. Also, be careful with the surface normals if you separate the polygons.
  • Mark Dygert
    Options
    Offline / Send Message
    It would require some coding and maybe an custom export plug-in to work in whatever engine. BUT you can assign it different Map Channels for each customization.

    I'm going to assume you are using Max?
    1) First save your UV layout, because when you change the map channel it resets the UV's.
    2) Add a new UnwrapUVW modifier.
    3) Set the Map Channel to 2 and load your saved UV layout.
    4) Edit and move the pieces for your first customization.
    5) Wash rinse repeat steps 1-4 until all your customizations have their own channel.

    Note: Careful what channel numbers you assign as other things could be using those channel numbers. Things like Vertex paint use the same channels, stupid I know. To help sort out any channel issues you might run into go Edit>Channel Info, this will help you see what channels are assigned to what =)
  • CrazyButcher
    Options
    Offline / Send Message
    CrazyButcher polycounter lvl 18
    technically easy is just moving/scaling.. texture coordinates. But they will be applied to all vertices. Ie the whole head uv layout is moved around in the texture. Just doing for "some" would be more messy.
    what I would do is create a uv-layout with only the customizations (like the topleft image) and generate this texture from individual pieces in code. Then you get 1 texture per "all customs" of a character.
    Keeping them tightly packed should remain cheap on the memory end. And especially easier to render, as 1 special texture now hosts all customs, and is blended using the 2nd texture coordinate set on top of the "bigger" image.

    then again if the heads arent super big in resolution one could generate the full head texture individually. Always depends on how many characters are meant to run around and how close they need to come up to camera...
  • East
    Options
    Offline / Send Message
    East polycounter lvl 14
    Thanks for the info, guys. I had to move on to more pressing matters (old fashioned 2D concept art), so this issue will have to take a back seat. But thanks again, this has been bookmarked smile.gif
Sign In or Register to comment.