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
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.
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
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...