Hi! I'm trying to track down a lighting issue I ran into when importing a hat into team fortress 2. Essentially the hat is always illuminated from the underside rather than in a manner consistent with the character or level. A picture of the kepi and lighting issue -
![kepiWIP01.jpg](http://jrosenkranz.com/misc/kepiWIP01.jpg)
I suspect there is something simple I am missing, but for the life of me I can't find anything. There are some entries one can insert into the .qc file ($illumposition, $upaxis, etc) which should help - but from my experimentation they don't appear to do anything.
Here is the .qc file I used -
$cd "C:\Commander's Log\kepi"
$modelname "engineer_bill.mdl"
$model "body" "kepiSMD.smd"
$upaxis Y
$sequence idle "idle" loop fps 30.00
$cdmaterials "models/player/items/engineer"
$illumposition 0 20 0
$ambientboost
$hboxset "default"
$hbox 0 "bip_head" -4.281 -8.838 -7.748 4.281 0.000 4.496
$collisionmodel "phymodel.smd" {
$mass 5.0
$inertia 1.00
$damping 0.00
$rotdamping 0.00
}
I modeled the hat in Maya and ran it through milkshape to export it into .smd format.
Anyway, thank you for any insight yall can provide!
Replies
I suspect you might want to try hacking out the detail map and the instructions that correspond to it.
While it is less pronounced due to the lack of specular highlights it is still obvious the hat is being illuminated from the bottom rather than the top side regardless of the settings that I've plugged in.
I am of the belief this is likely an issue with the model itself or the .qc file.
It is worth noting that the hat displays fine when viewed from the hl2 model viewer. http://jrosenkranz.com/misc/kepi02.jpg
One weird thing I ran into is that I had to rotate the hat 180 degrees because of a conflict of orientation between Maya and half life - I wonder if that could have anything to do with this?
Going back to the .qc file you might want to try it with these changes: The $illumposition is a command to rotate the orientation of the illumination in your case 20 degrees on Y, which could be causing it.
The $ambientboost should wash out the shadows but it shouldn't effect the highlights, but its not really necessary so might as well try it with out it and see how it goes.
$upaxis Y might be causing a problem too, if you remove it, the orientation of the hat will probably not match, but if you rotate and reset the hat to match the new reality it might shade correctly.
Am I, by chance, using them wrongly or is there a syntax error?
Other than that I'm out of ideas. If you post the mesh and texture files I could probably try a few things when I get some time.
Anyway, I would be much in your dept if you could have a look and root out where I went wrong. the source files and mdls can be gotten at here. Thanks!
It probably came from your exporter, so check your settings.
[Edit] I had a similar problem with a .smd exporter (wunderboy's but it works fine now), it looks like the normals have all been inverted on one of its Axis's.
Uploaded with ImageShack.us