Anyone know how the item coloring works ?

Discussion in 'Team Fortress 2 Talk' started by Loc_n_lol, Oct 1, 2010.

  1. Loc_n_lol

    Loc_n_lol L10: Glamorous Member

    Messages:
    726
    Positive Ratings:
    273
    Not that I'm really interested in buying paint myself but I'm curious about the technical aspect of it. Seems like the models don't actually feature skins (texturegroup) for those colors, any idea how it works ? Any screens of recolored items yet ?
     
  2. fubarFX

    aa fubarFX The "raw" in "nodraw"

    Messages:
    1,606
    Positive Ratings:
    1,696
    well, they don't need seperate textures. the bucket of paint probably has the same effect as adding a $colors in a vmt (which tints the whole vtf to a specified color). but yeah, my guess is that these temporary vmts might be dynamically generated. (that's why you don't find them in the gcf).

    wild guess here, don't take me seriously
     
    Last edited: Oct 1, 2010
  3. Nineaxis

    aa Nineaxis Quack Doctor

    Messages:
    1,767
    Positive Ratings:
    1,403
    I think they are just a tint masked to certain sections of hats.
     
  4. owly-oop

    aa owly-oop im birb

    Messages:
    817
    Positive Ratings:
    1,154
    Some hats seem to add tints, others seem to actually be recolored. The tints are ugly.
     
  5. Ravidge

    aa Ravidge Grand Vizier

    Messages:
    1,544
    Positive Ratings:
    2,492
    They have added a few lines to colorable items vmt's

    Example (from the pith helmet):
    Code:
    	"$blendtintbybasealpha" "1" 
    	"$blendtintcoloroverbase" "1"   // between 0-1 determines how much blended by tinting vs. replacing the color
    
    	"$colortint_base" "{157 150 142}" // put the RGB value of whats being colored when no paint is present, if $blendtintcoloroverbase is 0 then put [1 1 1] here.
    	"$colortint_tmp" "[0 0 0]"
    
    And a few more in the proxies section further down the same file:
    Code:
                    "ItemTintColor"
    		{
    			"resultVar" "$colortint_tmp"
    		}
    		"SelectFirstIfNonZero"
    		{
    			"srcVar1"	"$colortint_tmp"
    			"srcVar2"	"$colortint_base"
    			"resultVar" "$color2"
    		}
    
    The textures themselves use a alpha mask to decide what parts of the material gets tinted.
     
  6. Loc_n_lol

    Loc_n_lol L10: Glamorous Member

    Messages:
    726
    Positive Ratings:
    273
    Tints with a mask... hmmkay guess that makes sense.
    Didn't even know souce could do that :p
     
  7. Ravidge

    aa Ravidge Grand Vizier

    Messages:
    1,544
    Positive Ratings:
    2,492
    I think it's new.

    Actually, this opens up the question whether modelers can create multiple skins with masked tints instead of full materials (vmts are MUCH cheaper than vtfs) for map props.

    It's probably possible...
     
  8. Randdalf

    aa Randdalf

    Messages:
    1,054
    Positive Ratings:
    462
    Except you need to pay $2 to view the VMT :3
     
  9. Ravidge

    aa Ravidge Grand Vizier

    Messages:
    1,544
    Positive Ratings:
    2,492
    Yellow fence set $4.99
     
  10. REEJ

    REEJ L7: Fancy Member

    Messages:
    437
    Positive Ratings:
    167
    I'm just waiting to see some screenshot, don't wanna spoil my hats
     
  11. Mick-a-nator

    aa Mick-a-nator

    Messages:
    640
    Positive Ratings:
    314
    It came with Alien Swarm I think. A certain prop type in Alien Swarm SDK can have its colour changed. This is just an overall colour change, and only works well on specific models (they are very neutral in colour, like grey or even just white with an AO map).
    This is just adding a mask to that effect I think.
     
  12. Ravidge

    aa Ravidge Grand Vizier

    Messages:
    1,544
    Positive Ratings:
    2,492
    AS and L4D (colored cars) have used various tint tricks before, for AS you can edit the tint on any prop with a keyvalue, the prop itself is white. It offers really good customization and doesn't increase the map filesize at all.
    I dunno if that functionality has been ported to TF2 (I doubt it), but the ability to add masked tints to vmts as separate skins to custom models should now be possible (very filesize effective).

    Let's hope it works :)
     
  13. TMP

    aa TMP Abuser of Site Rules

    Messages:
    948
    Positive Ratings:
    551
    If you choose to use the paint on a hat, it shows you a preview of what it looks like.
     
  14. Terr

    aa Terr Cranky Coder

    Messages:
    1,591
    Positive Ratings:
    405
    Depending on how ugly paints are (and whether people can use them for a gameplay avantage) I hope there's a client-side option in the future to disable tinting.

    Y'know, to avoid the "Everything I have is a blu/red purple color guy".
     
  15. sniprpenguin

    sniprpenguin L6: Sharp Member

    Messages:
    266
    Positive Ratings:
    126
    DX8 systems can't run tinting.

    Need an upgrade here.