Home Technical Talk

tf2 specs

polycounter lvl 18
Offline / Send Message
Rhinokey polycounter lvl 18
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

  • Rob Galanakis
    Options
    Offline / Send Message
    The shaders in TF2 aren't fancy. They're actually quite simple. They just show off and work with the art really well, exactly what a shader should do. It is incorrect to assume that because something looks good it uses complicated or 'fancy' shaders. Sorry I don't have any answers, though.
  • Neo_God
    Options
    Offline / Send Message
    Neo_God polycounter lvl 18
    well as far as the shaders are concerned, since they are technically source models, all you'd do is just list what shaders you want on the model in the .VMT file. And to find out what they are, just unpack a tf2 model and take a look see.
  • CheeseOnToast
    Options
    Offline / Send Message
    CheeseOnToast greentooth
    That polycount you have is WAY off. I think that that might be the count for the high versions used in the "meet the" series.

    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 laugh.gif
  • Rhinokey
    Options
    Offline / Send Message
    Rhinokey polycounter lvl 18
    cheese i was looking in the viewer at the tf2 models in the playerfolder and they are all close to 16k where did you get your maya model? i posted some images i took from the model viewer here http://boards.polycount.net/showflat.php?Cat=0&Number=261849&an=0&page=0#Post261849
    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
  • CheeseOnToast
    Options
    Offline / Send Message
    CheeseOnToast greentooth
    My studio is a Source licensee so we get access to Valve's source files, including the rigged characters. There is a super-high version of each of the characters, but AFAIK they're mainly used in the cinematics. I think they can also be enabled for high-end video cards while playing too, so you could just go for it and make the higher poly one. The majority of the extra detail is in the face and mouth interior so that the facial animations look good.

    I'll try to double-check all this at work tomorrow anyway.
  • Emil Mujanovic
    Options
    Offline / Send Message
    Emil Mujanovic polycounter lvl 18
    Rhinokey, I did the same thing and was really surprised to see characters in the 15k mark. I thought it was a bit overkill for my own character and decided 5k would be enough. So I was curious to know the actual count for the characters used in the game.
    I'd be interested to hear the numbers you get, CheeseOnToast.

    -caseyjones
  • Rhinokey
    Options
    Offline / Send Message
    Rhinokey polycounter lvl 18
    here are screens of the medic and heavy models that are in the 3k range, medic around 3400 and heavy around 3800 neither at this range are using the eye shader, it doesnt pop on till around 6-7k models and the 3k medics face is far too low for the sweet anims seen in game. i'm becoming more convinced that the game does use the crazy high polys up close 3kheavy.jpg
    3kmedic.jpg
  • CheeseOnToast
    Options
    Offline / Send Message
    CheeseOnToast greentooth
    I did some digging around today and found out some more stuff. There are two versions of each character - a high version and a low one (not a LOD of the high btw, it's got its own QC file to compile from). I think you're posting the LODs from the high one where they're too far away to warrant using the eye shader and also don't use facial anims at that distance. These high models are used in the cinematics and I believe by machines with very high-spec cards.

    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 smile.gif 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.
  • Rhinokey
    Options
    Offline / Send Message
    Rhinokey polycounter lvl 18
    more info on what gfc and gfc explorer is?
  • Slum
    Options
    Offline / Send Message
    Slum polycounter lvl 18
    gfc is the format for compressed files for valve games. similar to quake pk3 if you're familliar with them. GCF requires special tools to browse/edit the packs, one called GCFScape.

    http://nemesis.thewavelength.net/index.php?p=25
  • El_Guiri
    Options
    Offline / Send Message
    Interesting stuff CheeseOnToast! valve switched to maya? excellent! I hope they update the vstSmdIO to maya 8.5

    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
  • CheeseOnToast
    Options
    Offline / Send Message
    CheeseOnToast greentooth
    SMD has been replaced with a new file type called DMX. We're still learning some of the details, but overall the whole export process has been streamlined and simplified compared to the old method. DMX files can also contain blendshape info, so you no longer need to export facial expressions as VTA files. Setting up eyes has been simplified a bit as well, at least to get them working at a basic level.

    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.
  • El_Guiri
    Options
    Offline / Send Message
    ohhhh great news!! and the blendshape info being saved straight into a DMX file is ace!!!

    (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!
  • Wej
    Options
    Offline / Send Message
    Wej
    Wow...

    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? crazy.gif
  • Rhinokey
    Options
    Offline / Send Message
    Rhinokey polycounter lvl 18
    triangles, always triangles
  • Michael Knubben
    Options
    Offline / Send Message
    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.
  • Wej
    Options
    Offline / Send Message
    Wej
    [ QUOTE ]
    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.
  • Mark Dygert
    Options
    Offline / Send Message
    I don't mean to thread high jack but this seems like a better spot to ask then starting a new thread.

    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?
  • CheeseOnToast
    Options
    Offline / Send Message
    CheeseOnToast greentooth
    I'm not sure exactly what you're asking Vig, but I'll try to explain what I know.

    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).
  • Mark Dygert
    Options
    Offline / Send Message
    Ahh thanks cheese that explained a lot.

    - 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!
  • CheeseOnToast
    Options
    Offline / Send Message
    CheeseOnToast greentooth
    Yeah, by mirrored I meant flipped UVs, like you would normally do for hands etc.

    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.
  • Mark Dygert
    Options
    Offline / Send Message
    I'm starting to understand why they didn't go for separate spec maps, when they have phong and env cube maps.

    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!
  • TorQue[MoD]
    Options
    Offline / Send Message
    TorQue[MoD] polycounter lvl 19
    Rhinokey, any chance the poly count being displayed in the model viewer is also including the poly count for the bones and ragdoll/collision mesh on top of the player mesh?

    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.
  • CheeseOnToast
    Options
    Offline / Send Message
    CheeseOnToast greentooth
    Vig, you need the line -

    "$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.
Sign In or Register to comment.