Difficulty: Moderate
Tools you'll need:
This tutorial will show you how to compile a shader that will allow your skin to show different colors for full or part of a skin when using the color selector in the species customization screen.
- The first thing you will need for this tutorial is a skin that you would like to have customizable colors for. Pick any skin, it won't matter for this tutorial.
- The first step will require image editing software, because we will have to alter the textures to prepare them for customization. You can use any image software, as long as it can create alpha channels. Gimp should work fine, as will photoshop. Select a texture you would like to be able to customize and open it in your image editing software.
- Select the portions you want to be able to colorize. Depending on what you want to be colorable this may take some time, as you should carefully select/outline those sections so you aren't coloring areas you don't want. When you have finished, create an alpha channel. If you aren't sure how to create an alpha channel, refer to your software's help files (usually accessible by hitting F1).
- Keeping your selection, create the alpha channel. It should default to a color, either black or white. It's not important right now what color it is, however make your selection the opposite color. If your alpha channel defaulted to black, make your selection white. If it defaulted white, make your selection black. Ultimately we want your selection to be black, so if the channel defaulted backwards, simply deselect and invert your colors (usually CTRL+I).
- Save your image as a targa file or a PNG if your software supports alpha channels for PNG files.
- Repeat these steps for any/all other files.
- That was the hard work. Really, I promise. Now it's all a bunch of copy-pasting what I give you to create the shader. First we will need a template, since I'm sure most of you (like me) are not able to create shaders from scratch. I stole the shader template from the base assets:
models/players/yourskin/yourtexture
{
{
map models/players/yourskin/yourtexture
blendFunc GL_ONE GL_ZERO
rgbGen lightingDiffuseEntity
}
{
map models/players/yourskin/yourtexture
blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
rgbGen lightingDiffuse
}
}
This template will help us create our shader, so copy it down and fill in the necessary information. Where it says "yourskin", put the name of the folder you used for your skin, or the name of the folder of the skin you're modifying. Where it says "yourtexture" put the name of the texture. For instance if you're modifying legs.tga, just put legs (leave off the *.tga extension).
- Your shader should look something like what I have listed below when you finish it up..
models/players/jedi_hm/robes01
{
{
map models/players/jedi_hm/robes01
blendFunc GL_ONE GL_ZERO
rgbGen lightingDiffuseEntity
}
{
map models/players/jedi_hm/robes01
blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
rgbGen lightingDiffuse
}
}
- Save your shader with a unique name (for instance I use the name of my skin, a hyphen, and my initials), then save it with a *.shader extension. If you're using notepad, to do this you simply type out the name, then select "all files" as your filetype.
- Pack up your *.PK3, adding the newly altered images and your shader. Test it out in-game! With any luck, you should be able to colorize those parts of the skin.
Helpful Hint: You can follow the same steps to get this effect on your icons, as well!
Back to Tutorials
|