i'm working on a character in tf2 style for fun, i've read a bit about their specs, close to 13k polys teeth and eyes modeled .
but i'm not sure, is it possible to put player models in tf2 at this point? and how would you do all the fancy shader stuff they use on the characters.
any links to resources would be helpfull. i'm going to make the model anyways so its not a big deal. just somethin i wanna do
Replies
I've got the maya version of the heavy open here (without weapons), and he's only around 3700 tris. I'd aim for around 5000 polys or less for an in-game character.
As prof 420 said, the shaders are pretty simple. It's mostly the rim light and a ramp texture (called phong warp or light warp texture in Source) that give them their look. The rest is pretty straightforward : diffuse, normal, spec (with a fresnel falloff) and gloss (called "exponent" in the .vmt).
The toughest bits to do are the eyes (they use a special shader and require some measurements to define size and movement ranges), and any facial animation. If you're a Maya user, it'll be easier to get this stuff working as Valve now uses Maya and their tools are made for it. I don't know how much of this stuff they're going to add to the public SDK though. Definitely aim to replace an existing character rather than start from scratch as there's a lot of complicated blending and things going on in the animation. Best of luck
i just looked in the viewer and the soldier starts at a 17k lod then steps to 1k thru about 5 difrent levels, you can set the auto lod to swap the models out as you zoom in and out
I'll try to double-check all this at work tomorrow anyway.
I'd be interested to hear the numbers you get, CheeseOnToast.
-caseyjones
The characters seen in-game are around 4000-6000 polys each, and have a simpler mouth interior than the one you mentioned in your first post, and they most definitely do use the eye shader, at least for the first few LODs. The Medic has much more detail in the face than the version you show above, just not 15000 polys worth They do use facial morphing as well, but don't use some of the fancy corrective blending available for the high res versions.
If you use GCF explorer to check out the "tf2 content.gcf", you'll see both versions under tf/models/player. The high versions are in another subfolder called hwm.
http://nemesis.thewavelength.net/index.php?p=25
I updated the sdk folder hoping they had something new in there but nope still same "CRC-32 115985DA" ....damn!!
have u used pralls smd plugin to get the model into maya? (just wondering if anything new is floating about)
Sammy
There's a whole bunch of Maya plugins and python scripts to make the whole process easier, but I have no idea when or if Valve are going to roll all of this out to the SDK. The documentation is still catching up with the engine, so maybe they'll wait until they have it written up properly before the public gets to see it.
(NB: in the maya plugin, they had DMX sprayed over with a red SMD...so they're going back to the dmx format again it seems.)
thanks for the heads up!
This is great info for me though, as i am making a mod for Half life, and so far, the head without a completed mouth (no teeth or tongue right now) i have about 1500 faces and 2600 triangles. Do i look at the faces or triangles for the poly count? And is that too much for the head?
Wej: Also, you can't just take these figures and copy them, unless your mod will a similar number of players onscreen, and similar type of levels (ie. not large opendoors areas). You need to take these things into account as well.
[/ QUOTE ]
I am making my own players. But that isn't the question. I know that my mod won't be the same, not even close, and i know you have to put the other things in account, the levels and weapons and stuff. (which my mod will have a lot of weapons, as the level is the weapons, though some may not be that detailed with polys), but i am trying to optimize the head, and ya....i don't think i did...
EDIT: And 1 more thing i might add is that the nonsmoothed version of the head has 848 polys...so if i have to, i can smooth it myself, making edgeloops, to completly optimize what i really need too...but this would be the last option.
Does anyone know of a good place to find some info about how they handled normal and spec maps on characters and environment props? The Valve Wiki seems kind of light on that info, or maybe I'm not using the right words in the search?
Normal maps still require unique UVs in Source AFAIK. There's one example where the normal is mirrored on one of the antlions, but I've not seen it anywhere else and I don't know how they did it. Most of the characters are pretty reliant on the actual geometry for detail. Their normalmaps are flat blue for the most part which allows for some mirroring since it doesn't matter if the UVs are reversed. The only areas that really make use of the map are clothing folds. There's no reason you can't do a fully normal mapped character/prop though. Just make sure there are no mirrored UVs.
Spec maps are greyscale and are usually embedded into the alpha channel of the normal map. It's possible to tint the colour of the spec based on the diffuse map (see below), but it's not very good IMO. Nothing like doing a full RGB spec anyway.
You can use a single exponent (gloss) value for a material, or you can make an exponent map. The exponent map can be an RGB or RGBA texture. The red channel is the gloss map, the green channel is (optionally) used to tint the specular colour based on your diffuse map. Black = no tint, white = fully tinted. As I said above, it doesn't work that well and the effect is fairly negligable compared with a full RGB spec map in other engines. The blue channel is currently unused. The alpha channel if present can be used to mask off the rimlight effect if necessary (some bits of a model can just look "wrong" with a rimlight on them).
Hope this helps a bit. It's probably worth having a dig around the team fortress 2 materials.gcf using GCFscape (Slum already posted the link above).
- Unique UV's huh... kind of a bummer but that confirms some of the tightly packed textures I've seen.
- Mirrored UV's? Do you mean overlapping or flipped/inverted UV pieces
- Spec Maps. For the life of me I couldn't find where they where hiding the spec maps. But in the alpha of the normal map, tricky bastards =P Not the first (or last) place I looked but it makes sense. So just adding the spec map to the alpha gets the spec working in game? I'll have test it out next time I'm at home.
- Exponent map, very interesting so the model needs to be rendered with phong? Isn't that kind of expensive and if it is, should I not use it for props. I guess thats just getting greedy I think it will look fine with just a spec map.
Thanks again, lots of good info, and you got me rolling again!
You dont need to tell the engine that the spec map is in the alpha channel of the normalmap. It looks there automagically. If you're not using a normal map but still want spec, you can put it in the alpha channel of your diffuse map, but you also need to add the line -
"$basemapalphaphongmask" "1"
to the VMT if you want to do it that way.
As for phong and TF2, they use it pretty heavily rather than the usual cubemapped shader. It can't have that much of a performance hit since many people find that TF2 runs faster than HL2, Counter Strike etc. However, quite a few of the materials seem to be simple diffuse-only jobs. Easy enough to "de-phong" stuff if the performance is dragging, since the base shader is still the standard vertexLitGeneric.
I will have to give phong a try. I would like to use a unified semi glossy paint for most of the metal props on the blue base. I have a few pretty big props sitting out in a wide open area and it might be too costly but it sounds pretty easy to toggle things on and off and test it all out. I also want to play around with reflections now that I'm starting to get a handle on them.
Can reflection maps be handled by the normal map alpha automaticly also or do I need a command line?
Does adding cube maps to a map chunk up its file size, I need to worry about final download size. No point in making a map if no one wants to waste bandwidth...
Next I need to figure out how to create 3D sky boxes, but one round of experiments at a time =P
I'm dying to try out half a dozen ideas, thanks again for all the pointers!
I don't know where to find the polycount in the model viewer, but my guess is it would be adding up everything since its all been compiled into one file.
I don't think there's a multiplayer game out there that would have a 16K poly character model. That's just too insanely high when you factor in matches with 32 - 64 players.
"$normalmapalphaenvmapmask" "1"
to use the alpha channel of the normal map to mask off reflections. Also look up "$envmaptint", "$envmapcontrast" and "$envmapsaturation" in the wiki. The tint variable is really useful, since you can reduce the strength of the reflections with it rather than having to edit the texture itself. Makes for quick tweaking. F5 refreshes all materials in the model viewer so it's quite a nice process for tweaking values like this.