What can I tell about shaders? Here's what I know:
- A shader is basically a texture (an image) with the addition of animations and/or parameters that make the surface using it something different than just plain bricks. Shaders are made of human-readable text, like small "scripts".
- A shader is like a texture: when you browse for textures in the editor, you see both "normal" textures and shaders (IIRC, there are options to show or hide shaders -showing just plain textures-, or to hide those that are not included in shaderlist.txt). IIRC, in the textures window, the texture has a border of a certain color if it's used in the map, and of another color if it's a shader (white and green? I don't remember now).
- Shader files are not created by the Radiant editor. You create them. Each .shader file can contain more shaders. Shaderlist.txt (
very important text file to be placed in baseoa/scripts folder, listing shader files editor and compiler have to load, one per line) does not mention single shaders, it just mentions shader files (without specifying .shader extension) that the editor has to load.
- Each shader has got a name (path), some properties (that define if it's made of water, if it has to emit light, etc. Many of them -but not all of them- require to recompile the map for the changes to be effective.), and then one or more "stages" (that define how it looks).
In the shader code you posted, the first line is the shader path/name. Then, the "deformVertexes" property specifies that the shape of the brush
[1] slightly changes (e.g. waves). Then, there are the "stages"... "lightmap" one is the one that specifies that the final look of the shader has to be lighter or darker depending from the illumination of the area (many shaders use lightmap stage, but some not: in this case, they do not look darker or lighter due to room illumination). Note: "Deformvertex" property deforms/animates
the brush... to just deform/animate the texture (more common), you use specific commands
in the stages instead.
-
Textures without a shader have the effect to be standard "solid" surfaces, that are not animated, do not deform... they just have the lightmap stage implicitly applied.
- A shader can have the same name of the texture it uses, or a separate name. In case it uses the same name of an image file, you will see it in the editor although
it would not have all its properties correctly applied unless its shader file is mentioned in shaderlist.txt. If the name of the shader does not correspond to an image file, it will be shown in the editor only if it's in shaderlist.txt. Sometimes, you may find useful to use a different name for the shader than the image, to be allowed to use both "static" and "shader-ized" version of the texture (IIRC, if the image file shares the same name with a shader, you are able to use the shader version only).
- A shader can blend (fuse) more textures using more stages (with different animations). You can use "qer_editorimage" parameter to specify which texture will be used to represent the shader
in the editor (qer_editorimage has no in-game effect).
-
The game loads all shaders, ignoring shaderlist.txt. However, many "properties" are elaborated at compiling time, so they may not completely work correctly (e.g. being solid although you wanted it non-solid) if the shader file was not listed in shaderlist at compiling time... or in case it has been modified after compiling. IIRC, "stages" can be altered without such problems.
- It's possible to select just a face of a brush, and apply to it a different texture/shader than the rest of the brush. Sometimes you will find this useful (e.g. with "caulk" and "nodraw" special shaders).
- In shaders, what followes a "//" is "commented out" and ignored. However, there are a few exceptions related to some "hacks" for specific video cards compatibility reasons or GLSL effects, that are threated as "comments" by older gamecode/engine and are executed by newer gamecode/engine (
I just tell you a few of these exceptions exist for your information, but don't care about them right now).
- If you wanna create a fully GPLv2 compatible map with your own shaders, you can copy and modify (of course changing path/name of the shader) existing OpenArena shaders, into your own .shader file. Shaders that come with Quake III Arena are not GPL'd, so you should not start from them.
- UPDATE (I forgot to mention it before): Just like happens with maps, if you don't set
sv_pure 0 before loading the map, the game will not load images and shader files that are not packaged into pk3 files! This may cause "missing textures" in game like in that screenshot from yours above (there may be other causes for "missing textures", of course).
Q3A shader manual:
http://www.heppler.com/shader/Q3MAP2 shader manual (q3map2, map compiler invoked by GTKRadiant, NetRadiant and some external tools such as Q3map2build, supports some more features than the original Q3map invoked by Q3Radiant):
http://q3map2.everyonelookbusy.net/shader_manual/Other infos, tutorials, etc:
(
DO NOT LINK) h t t p s : / / openarena . wikia . com/wiki/Mapping_resources_%26_tutorials
(
DO NOT LINK) h t t p s : / / openarena . wikia . com/wiki/Graphics_resources_%26_tutorials
[1] Note: "brush" is not intended as a paint brush, but as a... I don't know... polygon? In reality, more polygons are required to display a single brush... however, brushes are the base element of mapping.