Home Technical Talk

Having Problems With TF2 Hat Lighting

UPDATE: Okay so, I believe I know what the problem is. For some reason, the model for the hat is ungodly far away from the origin point when viewed by itself in the Model Viewer. However, if I try to move the model in Blender (the program I use) it moves away from the correct position on the Engineer's head. Does know of any way I can fix this? That way I can properly use the $illumposition command to light it properly.


I'm currently making a hat for the Engineer based off of "Double-D's" ski cap from Ed, Edd and Eddy. The model is fine and everything has compiled well enough, however I seem to be having some odd lighting issues.

Here's how it looks in the SDK Model Viewer...:

modelviewer1.jpgmodelviewer2.jpg

...and the Backpack Menu:

menupreview.jpgmenupreview2.jpg

Yet, for some reason the hat looks different in an actual game scenario as seen below:

hatdifference1.jpg

As you may be able to notice, the white lines on the cap have shrunk and are darker than the other examples. In fact, the entire hat is darker overall for some reason and I can't seem to figure out what is wrong.

Also, in some areas of a map the lines seem to disappear completely. Example below:

hatdifference2.jpg

I'm at a loss. If anyone can help, I'd really appreciate it. Here's the .vmt file for the texture if it makes any difference:
"VertexlitGeneric"
{
    "$baseTexture" "models\player\items\engineer/the_sockhedd"
    "$bumpmap" "models\effects/flat_normal" 

    "$yellow" "0"

    "$phong" "1"
    "$phongexponent" "10"
    "$phongboost" "0.1"
    "$lightwarptexture" "models/player/pyro/pyro_lightwarp"
    "$phongfresnelranges"    "[.25 .5 1]"

    "$rimlight" "1"
    "$rimlightexponent" "4"
    "$rimlightboost" ".65"
    

    "$cloakPassEnabled" "1"

    "Proxies"
    {
        "weapon_invis"
        {
        }
        "AnimatedTexture"
        {
            "animatedtexturevar" "$detail"
            "animatedtextureframenumvar" "$detailframe"
            "animatedtextureframerate" 30
        }
        "BurnLevel"
        {
            "resultVar" "$detailblendfactor"
        }
        "YellowLevel"
        {
            "resultVar" "$yellow"
        }
        "Equals"
        {
            "srcVar1"  "$yellow"
            "resultVar" "$color2"
        }
          "ItemTintColor"
          {
               "resultVar" "$colortint_tmp"
          }
          "SelectFirstIfNonZero"
          {
               "srcVar1" "$colortint_tmp"
               "srcVar2" "$colortint_base"
               "resultVar" "$color2"
          }
    }
}

Thanks!

Replies

  • Zipfinator
    Offline / Send Message
    Zipfinator polycounter lvl 9
    Only your first image is showing up for me so I can't see what's wrong in game.
  • TheBoxman
    Odd, let me try and fix that.
  • Zipfinator
    Offline / Send Message
    Zipfinator polycounter lvl 9
    They work now. First thing that comes to mind is the mipping is destroying the lines or painting is turned on somehow and messing it up. Are you testing it through the itemtest system or replacing another hat?
  • TheBoxman
    I've currently replaced the Ellis Cap to view this in game.
  • Noors
    Offline / Send Message
    Noors greentooth
    I'm not sure where your variables are defined. Not that i get how that shit is working, but are you sure about the "Proxies" part ? Maybe some variable isn't properly set ? Tint...Color...
  • TheBoxman
    Hmm, I think I see what you're getting at. Let me try fiddling around with that there...

    EDIT: Okay. After removing the color tint proxy the lines are a bit more prominent now, but they become almost invisible when walking through moderate shadow. Any ideas how I could make them less disappear-y?
  • Zipfinator
    Offline / Send Message
    Zipfinator polycounter lvl 9
    Is the Ellis Cap you replaced painted?

    Also you shouldn't replace the Ellis cap. Compile it as its own hat and type "itemtest" or "testitem" into the console. You can load your hat in game through there.

    Also those proxies should be fine if you copy/pasted them from another texture.
  • cman2k
    Offline / Send Message
    cman2k polycounter lvl 17
    look into using $illumposition

    Your model is lit from it's pivot point. If that pivot point is offset so it's inside of something or somewhere weird, then it's not going to get lit very well.

    I believe you can view your $illumposition in HLMV. Alternatively, you could just try and add some value to the middle number (Y-axis) so that the pivot is moved ABOVE the hat/head and not INSIDE of it.
  • TheBoxman
    Zipfinator wrote: »
    Is the Ellis Cap you replaced painted?

    Also you shouldn't replace the Ellis cap. Compile it as its own hat and type "itemtest" or "testitem" into the console. You can load your hat in game through there.

    Also those proxies should be fine if you copy/pasted them from another texture.

    Would you happen to know of a tutorial I could follow for this procedure? That'd be very helpful.

    cman2k wrote: »
    look into using $illumposition

    Your model is lit from it's pivot point. If that pivot point is offset so it's inside of something or somewhere weird, then it's not going to get lit very well.

    I believe you can view your $illumposition in HLMV. Alternatively, you could just try and add some value to the middle number (Y-axis) so that the pivot is moved ABOVE the hat/head and not INSIDE of it.

    Okay, i'll give that a shot.
Sign In or Register to comment.