Game Development Community

Question about reusable textures.

by Jason Gossiaux · in Artist Corner · 12/08/2008 (11:28 pm) · 2 replies

For a while now I've been using 1 texture per model. Unfortunately this results in a lot of waste. For my creatures I use 1024x1024 textures, and duplicating 90% of the texture when I just want to change what the head looks like doesn't make any sense. Similarly I'd like to use one giant 1024x1024 texture and use it with dozens of smaller models when applicable.

So, how does one go about setting this up?

Right now my pipeline for critters is Zbrush->MS3D->UUW3D So, I do one mesh, one material on export. Now in MS3D I see where I can assign a new texture for the head, but then how do I do the UV maps for that new texture?

Going a step further I'd eventually like to swap textures on the fly for my heads, arms, bodies of my models. I've seen a texture swapping resource for doing this over the entire body - maybe upon closer inspection it will work for just body parts.. I'll have to look. But for now I'll settle for just exporting entire models with different texture setups.

Maybe I don't understand all the power of my current tools. Anyone else out there not in the Max/Maya/Blender world found a workflow for this? Thanks a bunch!

#1
12/09/2008 (7:55 am)
You remap UV coordinates with the TextrueCoordinateEditor[CTRL+T] in Ms3d.....select the mesh grouping you want to edit, and open the TCE. Your faces should be inside the UV space, if they've been mapped, or collapsed into the upper left hand corner; 0,0. Ms3d has it's UV controls for scaling, rotating, moving...etc, in this dialog.

If you want to swap textures on the fly, stock TGE contains code that does this without any C++ changes, but only on the entire shape, not on a per-mesh group basis; that will take Source code changes. Take the texture you want to become your 'base' material and rename it to "base.textureName.extention" and reapply it to the mesh, like a new texture. Make certain this new texture bitmap is Applied to the mesh, and not the 'old' name of "player.png"

So, my 'base' KORK SDK for example has it's texture named, "base.player.png"...

I then took the bitmap and copied it 3 times, named each successively, "red.player.png", "green.player.png", and "blue.player.png". Then I went into a paint program and gave each bitmap color correction tinting towards each new 'color'...red/green/blue. Saved them out, in same folder with "base.player.png"....and then by grabbing the object handle and call
%obj.setSkinName("red");
, should instantly swap the base texture to the red tinted bitmap, and so on....for the entire shape. You could not swap the head and then the body...that will take C++ changes. But you do get a single bitmap with every 'setSkin' calling...and prepared texture. You only have to "apply" the 'base.player.png' in Ms3d for this to work. The engine does the rest to the other 3 textures...it simply looks up the name and renders that texture instead of the original exported 'base.player.png'.

Hope this helps a bit.

Personally, I'd touch up UV's in U3D and not Milkshape3D....
#2
12/09/2008 (8:11 am)
If you're interested in the engine changes Rex alludes do, there's a few resources to do it.
search for "SetSkinName" resources.
this seems like the most recent one.