The .skin files are used to place multiple skins on the same geometry. The purpose of the .skin file, in the loosest terms, is to tell the game to switch a shader over to a new one if the user asks for it. You’ll need to write two shaders and then go to another file type to link it in a way the game can read it to switch out the shader. The benefit of using .skin files is that you can get a lot of mileage out of the same geometry.

models/mapobjects/strogg/console/arcade_machine/a_machine
{
        noselfShadow
        unsmoothedtangents

        renderbump  -size 512 512 -aa 2 -trace .05 -MergeHigh models/mapobjects/strogg/arcade_machine/arcade_local.tga models/mapobjects/strogg/arcade_machine/arcade_main_hi.lwo

        bumpmap         addnormals (models/mapobjects/strogg/console/arcade_machine/a_machine_local.tga, heightmap (models/mapobjects/strogg/console/arcade_machine/a_machine_h.tga, 2))
        diffusemap              models/mapobjects/strogg/console/arcade_machine/a_machine_d.tga
        specularmap             models/mapobjects/strogg/console/arcade_machine/a_machine_s.tga
}

Next you’ll need to write a variant shader for the same geometry. This new file will have something different about it, like the disuse pass is different, or you’re replacing all of the support files except the _local map. Second example shader:

//yellow .skin for the arcade machine--------------------------------------------

models/mapobjects/strogg/console/arcade_machine/a_machine_yellow
{
        noselfShadow
        unsmoothedtangents

        bumpmap addnormals (models/mapobjects/strogg/console/arcade_machine/a_machine_local.tga, heightmap (models/mapobjects/strogg/console/arcade_machine/a_machine_yellow_h.tga, 2))
        diffusemap      models/mapobjects/strogg/console/arcade_machine/a_machine_yellow_d.tga
        specularmap     models/mapobjects/strogg/console/arcade_machine/a_machine_yellow_s.tga

}

In this case, we’ve kept most of the name the same, but added a _yellow to the end of the shader title name and the targas. Note: we’ve only replaced the _d, _h, and _s targa since we’d probably use the same _local map for the geometry. Don’t forget to save.

The skin directory should mirror the material directory. The difference is that all of the path names are in the folders. In the above case, you would use skins/mapobjects/strogg/console/arcade_machine.skin. Example:

skin skins/mapobjects/strogg/console/arcade_machine/a_machine_yellow
{
        "models/mapobjects/strogg/console/arcade_machine/a_machine" "models/mapobjects/strogg/console/arcade_machine/a_machine_yellow"
}

This is a skin entry. It breaks down pretty simple:

skin – A keyword telling the game that this is an active skin

skins/mapobjects/strogg/console/arcade_machine/a_machine_yellow – This is the name of the skin entry. This is the name the game looks for when you call out a .skin file in radiant.

{ - open bracket – Exactly like the open bracket for material files. All .skin files MUST have an open and close bracket.

"models/mapobjects/strogg/console/arcade_machine/a_machine" – The first set of quotes is the original skin the model has on it. It’s usually the main version of the shader.

"models/mapobjects/strogg/console/arcade_machine/a_machine_yellow” – The second set of quotes is the shader that will replace the original skin.

} – close bracket – This closes the .skin entry.

Save file.

ArtReference Q4Shaders SkinFiles (last edited 2005-11-04 21:40:37 by MattVainio)