Texturing tutorial
This document is broken up into 8 sections outlining the different aspects of texturing and use in maps for q3 Urban Terror.
> Proper
tiling
> The high pass filter
> Trim technique
> Advanced tiling
> Dirtying textures
> Misc. tips/tricks
> Map color theory
> Simple shaders (shiny windows)
Shiny windows I get alot of questions about this one, how to make the glass on window textures shiny. This method involves a window with an alpha channel, and a shader to make it happen. First select a window texture that you are going to use. |
![]() The window texture we are going to use. |
From here, create a new layer and use the paintbrush to paint with white over the window frame. This is part of the alpha channel creation. ( The alpha channel will be used to determine what areas of the texture are shiny in the shader, the white areas will be unaffected by shine, so you want to use white over your window frame. Unless of course your window frame is also shiny. ) Make sure you are painting on the new layer and not your background layer. |
![]() First step in creating an alpha image. |
Then create a new layer beneath the white frame layer and fill this with black. Click the blank area underneath the highlight in the image on the right, which will bring up the link icon. This means the two layers are linked. From here, go to layers>merge linked to flatten the two layers together. Then select the image, ( CTRL - A ) making sure you have the black/white newly flattened layer selected in the layers menu. From here, hit CTRL C to copy the image, then move on to the next step. |
![]() Further in creating the alpha image. |
Now you will want to click on the channels tab, which should be on the same palette as the layers. It is highlighted in the image on the right. Next you will want to create a new channel, which is the button highlighted at the bottom of the image on the right. After creating the new channel, which will be called Alpha 1, hit CTRL - V to paste the contents into the alpha channel. Remember, for all alpha channels, black is the area where the image is completely transparent, white is fully opaque, or not transparent. Greys are in-between values of partial transparency. |
![]() Creating a new channel and pasting in the alpha image. |
You are almost done, hit the layers tab to go back to the layers menu, then hit the garbage can icon in the lower right of the palette to delete the layer. This is an important step, you want the image to consist only of one layer, the background layer - and have the alpha channel in the channels palette. From here you will want to save the image as a 32 bit .TGA file. This is extremely important, if you save the image as a 24 bit .TGA or a JPG, the alpha channel will not be saved. |
![]() Finalizing the image. |
Next you need to look at the shader and change a few things depending on your file name. Here I have my shader for this window below. textures/sweetnutz/sn_window11a |
|
In the above shader, what you will need to change is everywhere it says textures/sweetnutz/sn_window11a - to whatever the name of your image is, and what folder it is in. So if you have textures/someguy/window7.tga, you'll need to put that in there. ( Note that the top line does not need the .tga as it is merely a name for the particular shader, not the image file you are using. ) I will explain the steps quickly here so that you can understand what is going on: { This stage is where the shiny part of the shader is first applied. The blend function here is set to to always lighten the texture with the tinfx.tga image. The tcgen environment stage is what sets up the shine to be an environment effect, used for creating shine and other effects that change depending on your location from the texture. This creates the illusion of a reflection. {
Here we have the texture we created above blended using the alpha channel. This means that the window frame portions will not be affected by the prior shine effect, since the alpha channel we created earlier tells it not to effect the window frame. { The final stage of the shader simply makes sure the texture is affected by the global lightmap, ( shadows and light / color values ) and blends the image with a default blend. |