GtkRadiant/Shader Syntax

A shader file consists of a series of surface attribute and rendering instructions formatted within braces: { and }. It uses a syntax similar to the C programming language. All shaders and shader examples in this book will be commented, with the comments being the stuff behind the //. Since this is commented out by the engine as well, you may just leave it if you copy and paste the shader. Below you can see a simple example of syntax and format for a single process, including the Q3Map2 keywords and Surface Parameters, which follow the first bracket and a single bracketed stage:

Shaders need to be referenced by the map editor, compiler (Q3Map2) and game engine - each of which uses a different part of the shader. In the above example shader, the different sections are listed on the right.