<li><aclass="backlink"title="Click to do a full-text search for this title"href="./ArtReference_Q4Shaders_SkinFiles?action=fullsearch&value=linkto%3A%22ArtReference+Q4Shaders+SkinFiles%22&context=180">ArtReference Q4Shaders SkinFiles</a></li>
<spanclass="anchor"id="line-1"></span><pclass="line874">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. <spanclass="anchor"id="line-2"></span><spanclass="anchor"id="line-3"></span><ul><listyle="list-style-type:none"><pclass="line891"><strong>5.1 Write all of the shaders you need for the .skin file.</strong> Generally you’ll start out with a base shader file the geometry uses. Ignore the render line, since it’s only used for render stage. First example shader: <spanclass="anchor"id="line-4"></span><spanclass="anchor"id="line-5"></span></li></ul><pclass="line867"><spanclass="anchor"id="line-6"></span><pre>models/mapobjects/strogg/console/arcade_machine/a_machine
<spanclass="anchor"id="line-17"></span></pre><spanclass="anchor"id="line-18"></span><pclass="line874">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: <spanclass="anchor"id="line-19"></span><spanclass="anchor"id="line-20"></span><pre>//yellow .skin for the arcade machine--------------------------------------------
<spanclass="anchor"id="line-32"></span></pre><spanclass="anchor"id="line-33"></span><pclass="line874">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. <spanclass="anchor"id="line-34"></span><spanclass="anchor"id="line-35"></span><ul><listyle="list-style-type:none"><pclass="line891"><strong>5.2 Now that you have two shaders, what do you do with them?</strong> First, make sure you have temp targa files in the correct directories with the diffuse targa a different color than the main skin page (Disregard if you’ve already painted the new skin). You’ll need to make a .skin file to allow for the game to switch between the two shader entries. <spanclass="anchor"id="line-36"></span><spanclass="anchor"id="line-37"></span><pclass="line891"><strong>5.3 You’ll need to create a .skin file folder in the same area as your material folder</strong>: Under the pk4 files and beneath your materials folder, you’ll need to create another folder and name it skins. You’ll need to create your skin files locally. Meaning you’ll have to create them on your computer and then save them out in the appropriate directory inside the Quake4 game. <spanclass="anchor"id="line-38"></span><spanclass="anchor"id="line-39"></span><oltype="i"><li>Through your computer’s Explorer, go into the Quake4 directories. (C:\Program Files\id Software\Quake 4) <spanclass="anchor"id="line-40"></span><spanclass="anchor"id="line-41"></span></li><liclass="gap">Open the q4base folder and find the pk4 files. <spanclass="anchor"id="line-42"></span><spanclass="anchor"id="line-43"></span></li><liclass="gap">Underneath the pk4 files and beneath the materials folder, you’ll need to create a skins folder. Name it skins in all lower case letters. You’ll also want to create sub-folders inside the skins folder for models , mapobjects, etc. <spanclass="anchor"id="line-44"></span><spanclass="anchor"id="line-45"></span></li><liclass="gap">Open notepad on your computer and write out your model’s .skin file. <spanclass="anchor"id="line-46"></span><spanclass="anchor"id="line-47"></span></li><liclass="gap">After writing your .skin file, name it and save it as an .skin file in your newly created skins folder. Don’t save as a .txt file, but as an .skin file. You can easily rewrite the suffix to .skin. <spanclass="anchor"id="line-48"></span><spanclass="anchor"id="line-49"></span></li></ol></li></ul><pclass="line874">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: <spanclass="anchor"id="line-50"></span><spanclass="anchor"id="line-51"></span><pre>skin skins/mapobjects/strogg/console/arcade_machine/a_machine_yellow
<spanclass="anchor"id="line-55"></span></pre><spanclass="anchor"id="line-56"></span><pclass="line874">This is a skin entry. It breaks down pretty simple: <spanclass="anchor"id="line-57"></span><spanclass="anchor"id="line-58"></span><pclass="line867"><tt>skin</tt>– A keyword telling the game that this is an active skin <spanclass="anchor"id="line-59"></span><spanclass="anchor"id="line-60"></span><pclass="line867"><tt>skins/mapobjects/strogg/console/arcade_machine/a_machine_yellow</tt>– 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. <spanclass="anchor"id="line-61"></span><spanclass="anchor"id="line-62"></span><pclass="line867"><tt>{ - open bracket</tt>– Exactly like the open bracket for material files. All .skin files MUST have an open and close bracket. <spanclass="anchor"id="line-63"></span><spanclass="anchor"id="line-64"></span><pclass="line867"><tt>"models/mapobjects/strogg/console/arcade_machine/a_machine"</tt>– The first set of quotes is the original skin the model has on it. It’s usually the main version of the shader. <spanclass="anchor"id="line-65"></span><spanclass="anchor"id="line-66"></span><pclass="line867"><tt>"models/mapobjects/strogg/console/arcade_machine/a_machine_yellow”</tt>– The second set of quotes is the shader that will replace the original skin. <spanclass="anchor"id="line-67"></span><spanclass="anchor"id="line-68"></span><pclass="line867"><tt>} – close bracket</tt>– This closes the .skin entry. <spanclass="anchor"id="line-69"></span><spanclass="anchor"id="line-70"></span><pclass="line867"><strong>Save file.</strong><spanclass="anchor"id="line-71"></span><spanclass="anchor"id="line-72"></span><ul><listyle="list-style-type:none"><pclass="line891"><strong>5.4 So, I have this all set up…now what?</strong> Ok, now you need to check if the .skin will work. You’ll need to load the model’s geometry in radiant and check your work. <spanclass="anchor"id="line-73"></span><oltype="i"><li>Run q4local.exe <spanclass="anchor"id="line-74"></span><spanclass="anchor"id="line-75"></span></li><liclass="gap">Drop down the console (hit ~) and type in editor. <spanclass="anchor"id="line-76"></span><spanclass="anchor"id="line-77"></span></li><liclass="gap">Let the editor load up and right click in the XY top window <spanclass="anchor"id="line-78"></span><spanclass="anchor"id="line-79"></span></li><liclass="gap">In the pop down menu select “new model…” <spanclass="anchor"id="line-80"></span><spanclass="anchor"id="line-81"></span></li><liclass="gap">A dialog box will appear with a “base” folder. <spanclass="anchor"id="line-82"></span><spanclass="anchor"id="line-83"></span><oltype="a"><li>Find your low poly model <spanclass="anchor"id="line-84"></span><spanclass="anchor"id="line-85"></span></li><liclass="gap">Highlight it and click OK <spanclass="anchor"id="line-86"></span><spanclass="anchor"id="line-87"></span></li><liclass="gap">Allow the model to load <spanclass="anchor"id="line-88"></span><spanclass="anchor"id="line-89"></span></li></ol></li><liclass="gap">With the model highlighted go to the Inspectors window <spanclass="anchor"id="line-90"></span><spanclass="anchor"id="line-91"></span><oltype="a"><li>DO NOT HIT THE SKIN BUTTON (it is currently broken, or at least it was) <spanclass="anchor"id="line-92"></span><spanclass="anchor"id="line-93"></span></li><liclass="gap">Go the Key window and type in skin <spanclass="anchor"id="line-94"></span><spanclass="anchor"id="line-95"></span></li><liclass="gap"><pclass="line862">Underneath it is the Value window type in the skin name: In the above example: <tt>skins/mapobjects/strogg/console/arcade_machine/a_machine_yellow</tt><spanclass="anchor"id="line-96"></span><spanclass="anchor"id="line-97"></span></li><liclass="gap">Hit enter <spanclass="anchor"id="line-98"></span><spanclass="anchor"id="line-99"></span></li></ol></li><
<li><ahref="http://moinmoin.wikiwikiweb.de/">MoinMoin Powered</a></li><li><ahref="http://www.python.org/">Python Powered</a></li><li><ahref="http://validator.w3.org/check?uri=referer">Valid HTML 4.01</a></li>