Shaders 365: Lesson 1
The Necessities of Shaders


Shaders are very important if you want to have a nice looking map. There are some things you need to know first before we get started. A shader is a file with simple command lines that changes the way textures look in game. You can achieve many different looks with them. They are mainly used for making water, fog, or skyboxes but can also be used for many other things.

For example: If you wanted a much simpler way to do the lighting in your map and make it look better than regular entity lights you could use shader lights. Or if you wanted to add some eye candy you could use an environment map.


Here you see what shader lights can do to the look of a map:



 

Environment maps can add eye candy to the map:



 

Shaders can also be used to make slime. You can even make it glow:



 

As you will learn how to do later, shaders can be used to make water as well:



 

Here are some basic terms and things that you will need to know when making a shader:

A command line that starts with q3map_ will require you to recompile the map when you change a value in one of these lines.

A command line that starts with surfaceparm can be changed without a recompile. These affect the surface parameters of the texture, such as the volume of the brush (water, slime, lava, fog, etc.) or the transparency or slickness of a surface.

A command line that starts with qer_ only affects something in the editor, like editor transparency or the image that is displayed in the editor.

An environment map is a way that a texture is displayed in the game. It makes it look like glass. Envmaps, as they are called in short terms, make it look like the texture is reflecting an image of your choice. These can make a floor look like it is reflecting the room without using a portal which would drain the FPS. They don't actually "reflect" anything.

When you see tcGen, this stands for texture coordinate generation and affects what and how the texture looks in game.

You can edit and create shaders best with textpad.

When you make a custom shader, put it in base/shaders/. You will also need to add it to shaderlist.txt, which is also found in the shaders folder. This will allow the editor to load them correctly.

A lightmap is the things that cause your map to have lights. They are an image that is made during the light phase and then pasted over all textured surfaces in game.

Shaders can be confusing at first but if you stick with them you can do some pretty cool things. Just hang in there!
 

Back to Home