<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://wiki.splashdamage.com/index.php?action=history&amp;feed=atom&amp;title=Materials</id>
	<title>Materials - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.splashdamage.com/index.php?action=history&amp;feed=atom&amp;title=Materials"/>
	<link rel="alternate" type="text/html" href="https://wiki.splashdamage.com/index.php?title=Materials&amp;action=history"/>
	<updated>2026-04-07T15:00:08Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.31.0</generator>
	<entry>
		<id>https://wiki.splashdamage.com/index.php?title=Materials&amp;diff=3871&amp;oldid=prev</id>
		<title>MoP: declarations not decls</title>
		<link rel="alternate" type="text/html" href="https://wiki.splashdamage.com/index.php?title=Materials&amp;diff=3871&amp;oldid=prev"/>
		<updated>2007-12-04T15:10:14Z</updated>

		<summary type="html">&lt;p&gt;declarations not decls&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en-GB&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 15:10, 4 December 2007&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot; &gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Material &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;decls &lt;/del&gt;are similar to shader files from Quake3, but they are a lot more powerful. Materials have a lot of power, especially when combined with scripts and GL programs. Material declarations are stored in ''.mtr'' files.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Material &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;declarations &lt;/ins&gt;are similar to shader files from Quake3, but they are a lot more powerful. Materials have a lot of power, especially when combined with scripts and GL programs. Material declarations are stored in ''.mtr'' files.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;For a simple overview of how to create a new material, [[Adding Custom Textures|see this tutorial]].&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;For a simple overview of how to create a new material, [[Adding Custom Textures|see this tutorial]].&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>MoP</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.splashdamage.com/index.php?title=Materials&amp;diff=3869&amp;oldid=prev</id>
		<title>MoP: shuffled headings around for better order, made the example less doom3-like, moved reference to new page for filesize</title>
		<link rel="alternate" type="text/html" href="https://wiki.splashdamage.com/index.php?title=Materials&amp;diff=3869&amp;oldid=prev"/>
		<updated>2007-12-04T15:08:52Z</updated>

		<summary type="html">&lt;p&gt;shuffled headings around for better order, made the example less doom3-like, moved reference to new page for filesize&lt;/p&gt;
&lt;a href=&quot;https://wiki.splashdamage.com/index.php?title=Materials&amp;amp;diff=3869&amp;amp;oldid=3236&quot;&gt;Show changes&lt;/a&gt;</summary>
		<author><name>MoP</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.splashdamage.com/index.php?title=Materials&amp;diff=3236&amp;oldid=prev</id>
		<title>192.168.0.129: Tabulated everything</title>
		<link rel="alternate" type="text/html" href="https://wiki.splashdamage.com/index.php?title=Materials&amp;diff=3236&amp;oldid=prev"/>
		<updated>2007-11-16T13:59:46Z</updated>

		<summary type="html">&lt;p&gt;Tabulated everything&lt;/p&gt;
&lt;a href=&quot;https://wiki.splashdamage.com/index.php?title=Materials&amp;amp;diff=3236&amp;amp;oldid=1510&quot;&gt;Show changes&lt;/a&gt;</summary>
		<author><name>192.168.0.129</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.splashdamage.com/index.php?title=Materials&amp;diff=1510&amp;oldid=prev</id>
		<title>MoP at 09:40, 17 October 2007</title>
		<link rel="alternate" type="text/html" href="https://wiki.splashdamage.com/index.php?title=Materials&amp;diff=1510&amp;oldid=prev"/>
		<updated>2007-10-17T09:40:41Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Material decls are similar to shader files from Quake3, but they are a lot more powerful. Materials have a lot of power, especially when combined with scripts and GL programs. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Tables ==&lt;br /&gt;
&lt;br /&gt;
In Quake3, you could do all kinds of neat things with sin waves, saw tooth waves, square waves and other types of waves, but you were pretty much screwed if you wanted any kind of non standard wave form. In Doom 3, you can define arbitrary data lookup tables, then reference them in your materials. &lt;br /&gt;
The format of a table definiton is: &lt;br /&gt;
&lt;br /&gt;
    table &amp;lt;tablename&amp;gt; { [snap] [clamp] { &amp;lt;data&amp;gt;, &amp;lt;data&amp;gt;, ... } }&lt;br /&gt;
Where [snap] is an optional key word which means &amp;quot;jump directly from one value to the other (don't blend between values)&amp;quot; and [clamp] is an optional key word which means &amp;quot;don't wrap around if the index is outside the range of table elements, (return the first value if less or the last value if it's more)&amp;quot;. Both keywords are optional, and can be used together. &lt;br /&gt;
Now, armed with this knowledge, we can easily construct a square wave lookup table: &lt;br /&gt;
&lt;br /&gt;
    table squarewave { snap { 0, 1 } }&lt;br /&gt;
The sin table is a bit harder, but lucky for you, it's already defined shaderDemo.mtr &lt;br /&gt;
&lt;br /&gt;
== Materials ==&lt;br /&gt;
&lt;br /&gt;
Every material file has a global section, followed by one or more stages. The global section, as the name implies, sets properties that affect all the stages. In Quake3 the stages were pretty easy to understand because the engine rendered them in order: stage 1, then stage 2, then stage 3, etc.. In Doom 3 the order is not quite as simple because of the way the lighting system works, but for the most part, they are still rendered in order. &lt;br /&gt;
Let's look at a simple material (some random wall in the alpha labs): &lt;br /&gt;
&lt;br /&gt;
    material textures/alphalabs/a_lfwall21b&lt;br /&gt;
    {&lt;br /&gt;
        qer_editorimage textures/alphalabs/a_lfwall21b&lt;br /&gt;
        bumpmap         textures/base_wall/lfwall21_local&lt;br /&gt;
        diffusemap      textures/alphalabs/a_lfwall21b&lt;br /&gt;
        specularmap     textures/alphalabs/a_lfwall21b_s&lt;br /&gt;
    }&lt;br /&gt;
The first line is the name of the material (which in this case also happens to be the name of the diffuse map). Notice the use of the 'material' keyword. This is required for all materials, unlike Doom3.&lt;br /&gt;
&lt;br /&gt;
The global section begins right after the open curly brace. The first key word we see is qer_editorimage, which tells Radiant which image to use in the editor. This is the image used in the texture window, as well as in the 3D view. Next we define the bump map (normal map), the diffuse map (colors), and the specular map (gloss). This is about as basic of a material file you can get, while still using the advanced lighting features. Technically all you need is 'diffusemap', in which case the specular map is black, the bump map is blue, and the editorimage is the diffusemap. Creating an entire map with those types of materials will look roughly like Quake 3.&lt;br /&gt;
In most cases you won't need to specify the qer_editorimage unless you specifically need something which looks different to the diffusemap.&lt;br /&gt;
&lt;br /&gt;
This material looks like it doesn't have any stages, but in fact it has 3 stages. The 'bumpmap' 'diffusemap' and 'specularmap' keywords are simply shortcuts for stages as we will see later.&lt;br /&gt;
&lt;br /&gt;
== Shaders in Materials ==&lt;br /&gt;
&lt;br /&gt;
ETQW has the ability to use custom GL vertex and fragment programs when rendering a stage of a material. This is mostly seen in the 'heat haze' effects around fire, in the warping effects on glass, and in the warping effects on various projectiles (like the BFG). For documentation on how to write your own renderprograms programs, see the separate [[Render program documentation]] &lt;br /&gt;
&lt;br /&gt;
There is nothing stopping an artist from writing those, but I would really let a programmer handle writing the renderprogram. The main thing an artist or level designer needs to know is how to use the renderprogram in their materials. &lt;br /&gt;
This is the material file for the hornet smoke which uses one of the heathaze effects. Using other renderprograms works in a similar way:&lt;br /&gt;
&lt;br /&gt;
    material particles/penta/hornetheathaze {&lt;br /&gt;
        noshadows&lt;br /&gt;
        translucent&lt;br /&gt;
        nonsolid&lt;br /&gt;
        {&lt;br /&gt;
            program heatHazeWithVertex&lt;br /&gt;
            deformScroll 0, 0&lt;br /&gt;
            deformMagnitude 1&lt;br /&gt;
            bumpMap textures/particles/smoke/smokenormal.tga   &lt;br /&gt;
            maskAlpha&lt;br /&gt;
        }	&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
There is a single stage in this material. It uses a special program, this means it will not render like any other material but that it will use that program to do some special effect. It also means that certain parameters are surrendly read by the engine.&lt;br /&gt;
So the heatHazeWithVertex causes the engine to render the stage as a heathaze surface, it also looks at the values of deformScroll and deformMagnitude to define the specific strength of the heathaze effect (how much warping is going on). The engine automatically knows at which parameters to read when you use a certain program, so while you can set these parameters on any material only programs that actually use them will care about their value. Also note how the texture is specified using the bumpMap [bleh] command, altough you use the bumpmap command here it won't render like any other bumpmapped surface since the &amp;quot;program heatHazeWithVertex&amp;quot; told the engine to do special rendering for this surface.&lt;br /&gt;
&lt;br /&gt;
The list of new &amp;quot;commands&amp;quot; that are available when you use a certain program is not fixed, so every new program may define new variables you can set. Most programs tend to use the default values like &amp;quot;map&amp;quot;, &amp;quot;bumpMap&amp;quot;, &amp;quot;diffuseMap&amp;quot;, ... so most of the time you don't need to know about any special variables to use the program.&lt;br /&gt;
&lt;br /&gt;
== Maths and Logic ==&lt;br /&gt;
&lt;br /&gt;
Materials in Doom 3 can contain mathematical and logical expressions. These expressions are evaluated for each material every frame, and are what cause normally boring surfaces to come alive. This is a replacement for the rather limited shader commands in Quake 3 such as tcMod scroll, rgbGen, etc. &lt;br /&gt;
Let's take a look at a material to see these features in use: &lt;br /&gt;
&lt;br /&gt;
    material models/weapons/soulcube/soulcube3fx&lt;br /&gt;
    {&lt;br /&gt;
        noSelfShadow&lt;br /&gt;
        translucent&lt;br /&gt;
        noShadows&lt;br /&gt;
        {&lt;br /&gt;
            if ( parm7 &amp;gt; 3 )&lt;br /&gt;
            blend add&lt;br /&gt;
            map models/weapons/soulcube/soulcube3fx&lt;br /&gt;
            rgb scTable[ time * .5 ] &lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
In Doom 3, certain stages of the material can be selectively turned on and off. The 'if' command in this example means &amp;quot;only draw this material if parm7 is greater than 3.&amp;quot; There are a few places where parm7 can get set, one of them is in the editor with the 'shaderParm0' to 'shaderParm11' keys. Another place is in the script file (such as with weapons). Of course, it can also get set in the code. &lt;br /&gt;
&lt;br /&gt;
Notice the use of a lookup table in this material. Here we are using 'time' (which is a floating point number that increases forever) to look up a value in 'scTable' (which was defined using a 'table' decl earlier). &lt;br /&gt;
&lt;br /&gt;
The mathematical operators you can use in a material are %, /, *, -, and +. You can also use the boolean operators &amp;lt;, &amp;gt;, &amp;lt;=, &amp;gt;=, ==, !=, &amp;amp;&amp;amp;, and ||. The meaning of the symbols is the same as in C/C++, Java, PHP, etc. Mathematical expressions should be enclosed in parenthesis (there are cases where they don't have to be, such as when they are used as an index to a lookup table, but it never hurts to have too many. For the operands, you can use a lookup table, any numerical constant, and any of the following variables: &lt;br /&gt;
&lt;br /&gt;
time: Forever increasing floating point value that returns the current time in seconds &lt;br /&gt;
parm0-parm11: Parameters that can be set a number of ways (discussed above) &lt;br /&gt;
global0-global7: Not used right now &lt;br /&gt;
fragmentPrograms: Constant that is 1 if ARB fragment programs are available. This is mostly used for disabling a stage by specifying &amp;quot;if ( fragmentPrograms == 1 )&amp;quot; &lt;br /&gt;
sound: The current sound amplitude of the entity using this material. This is used to create light materials that pulse with the sound.&lt;br /&gt;
&lt;br /&gt;
== New backend ==&lt;br /&gt;
&lt;br /&gt;
The new backend slightly changes the way how shaders work, altough internally the system is very different we tried to keep external changes as small as possible. The next few topics are mainly &amp;quot;copy pastable&amp;quot; cases.&lt;br /&gt;
&lt;br /&gt;
=== Alphatested surfaces ===&lt;br /&gt;
&lt;br /&gt;
Unlike doom3 bump/specular/diffuse maps are not treated as separate material stages anymore, so instead of having three stages with one map each you now have one stage with the three maps specified at once. This makes for less stages and a generally more intuitive way of creating shaders.&lt;br /&gt;
The biggest change because of this is the alpha testing. While you specified the bump and specular stages like normal stages and specified added the alphatest on the diffuse stage before, now you need one stage with has diffuse+bump+specular maps with alpha testing enabled.&lt;br /&gt;
An alpha tested stage now looks like this:&lt;br /&gt;
&lt;br /&gt;
    material textures/alphademo {    &lt;br /&gt;
        {&lt;br /&gt;
            diffusemap  textures/decals/fgrill2_d.tga&lt;br /&gt;
            specularmap textures/decals/fgrill2_s.tga&lt;br /&gt;
            bumpmap     addnormals( textures/decals/fgrill_local.tga , heightmap ( textures/decals/fgrill2_b.tga, 1 ) )	 	&lt;br /&gt;
            &lt;br /&gt;
            alphaTest 0.5&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
=== Clamped textures ===&lt;br /&gt;
&lt;br /&gt;
Clamping was specified in the shader/stage body before, this is not very logical as it is actually an image parameter. Therefore clamping now has to be specified before image names.&lt;br /&gt;
&lt;br /&gt;
    material textures/clampdemo {    &lt;br /&gt;
        {&lt;br /&gt;
            blend add&lt;br /&gt;
            map clamp textures/decals/blast.tga&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
=== Animated texture coordinates ===&lt;br /&gt;
&lt;br /&gt;
Since bump/normal/specular are now part of a single stage( see alphatest information ) the texture matrices can't be specified per stage anymore, therefore there is a new &amp;quot;texturematrix&amp;quot; command you can use to specify the texture matrix of a specific texture.&lt;br /&gt;
&lt;br /&gt;
    material textures/matrixdemo { &lt;br /&gt;
        {&lt;br /&gt;
            bumpmap textures/base_wall/wire_fence2_local.tga&lt;br /&gt;
            specularmap textures/base_wall/a_wire_fence2_s.tga&lt;br /&gt;
            diffusemap textures/base_wall/a_wire_fence2_d.tga&lt;br /&gt;
            alphaTest 0.5&lt;br /&gt;
            &lt;br /&gt;
            textureMatrix bumpMatrix {&lt;br /&gt;
                translate 2, 2&lt;br /&gt;
            }&lt;br /&gt;
            &lt;br /&gt;
            textureMatrix specularMatrix {&lt;br /&gt;
                translate 4, 4&lt;br /&gt;
            }		&lt;br /&gt;
            &lt;br /&gt;
            textureMatrix diffuseMatrix {&lt;br /&gt;
                translate 2, 2&lt;br /&gt;
            }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
You can still use the old texture matrix system, but this means it will only affect the diffuse map and NOT the specular/normal map. If you are writing a non bumpmapped material you should also use the old way of specifying texture matrices.&lt;br /&gt;
&lt;br /&gt;
== Reference (Beware: copy paste from doom 3 out of date likely!) ==&lt;br /&gt;
&lt;br /&gt;
=== Global Keywords for regular materials ===&lt;br /&gt;
{| style=&amp;quot;border: 1px solid #AAAAAA;&amp;quot; width=&amp;quot;100%&amp;quot;&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; style=&amp;quot;border-bottom: 1px solid #AAAAAA; background: #F0F0F0;&amp;quot; | qer_editorimage &amp;lt;map&amp;gt;&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; style=&amp;quot;border-bottom: 1px solid #AAAAAA;&amp;quot; | Image to display in the editor&lt;br /&gt;
|-&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; style=&amp;quot;border-bottom: 1px solid #AAAAAA; background: #F0F0F0;&amp;quot; | description &amp;lt;string&amp;gt;&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; style=&amp;quot;border-bottom: 1px solid #AAAAAA;&amp;quot; | Just a simple description for people using this material&lt;br /&gt;
|-&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; style=&amp;quot;border-bottom: 1px solid #AAAAAA; background: #F0F0F0;&amp;quot; | polygonOffset&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; style=&amp;quot;border-bottom: 1px solid #AAAAAA;&amp;quot; | [float] offset the depth buffer to combat z-fighting&lt;br /&gt;
|-&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; style=&amp;quot;border-bottom: 1px solid #AAAAAA; background: #F0F0F0;&amp;quot; | noShadows&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; style=&amp;quot;border-bottom: 1px solid #AAAAAA;&amp;quot; | Don't cast shadows&lt;br /&gt;
|-&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; style=&amp;quot;border-bottom: 1px solid #AAAAAA; background: #F0F0F0;&amp;quot; | noSelfShadow&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; style=&amp;quot;border-bottom: 1px solid #AAAAAA;&amp;quot; | This material doesn't cast shadows on the model it's on (but it does on other models)&lt;br /&gt;
|-&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; style=&amp;quot;border-bottom: 1px solid #AAAAAA; background: #F0F0F0;&amp;quot; | forceShadows&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; style=&amp;quot;border-bottom: 1px solid #AAAAAA;&amp;quot; | Allows nodraw surfaces to cast shadows&lt;br /&gt;
|-  &lt;br /&gt;
| valign=&amp;quot;top&amp;quot; style=&amp;quot;border-bottom: 1px solid #AAAAAA; background: #F0F0F0;&amp;quot; | noOverlays&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; style=&amp;quot;border-bottom: 1px solid #AAAAAA;&amp;quot; | Overlay / Decal suppression&lt;br /&gt;
|-&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; style=&amp;quot;border-bottom: 1px solid #AAAAAA; background: #F0F0F0;&amp;quot; | forceOverlays&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; style=&amp;quot;border-bottom: 1px solid #AAAAAA;&amp;quot; | Force decal overlays for alpha tested or translucent surfaces&lt;br /&gt;
|-&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; style=&amp;quot;border-bottom: 1px solid #AAAAAA; background: #F0F0F0;&amp;quot; | translucent&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; style=&amp;quot;border-bottom: 1px solid #AAAAAA;&amp;quot; | The engine thinks this is a translucent material (which means no ambient/zfill pass will be done for this material)&lt;br /&gt;
|-&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; style=&amp;quot;border-bottom: 1px solid #AAAAAA; background: #F0F0F0;&amp;quot; | forceOpaque&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; style=&amp;quot;border-bottom: 1px solid #AAAAAA;&amp;quot; | Opposite forces the engine to think this is a nontranslucent material.&lt;br /&gt;
|-&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; style=&amp;quot;border-bottom: 1px solid #AAAAAA; background: #F0F0F0;&amp;quot; | twoSided&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; style=&amp;quot;border-bottom: 1px solid #AAAAAA;&amp;quot; | Draw the front and back. Implies no-shadows, because the shadow volume would be coplanar with the surface, giving depth fighting&amp;lt;/td&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; style=&amp;quot;border-bottom: 1px solid #AAAAAA; background: #F0F0F0;&amp;quot; | backSided&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; style=&amp;quot;border-bottom: 1px solid #AAAAAA;&amp;quot; | Draw only the back. This also implies no-shadows&amp;lt;/td&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; style=&amp;quot;border-bottom: 1px solid #AAAAAA; background: #F0F0F0;&amp;quot; | mirror&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; style=&amp;quot;border-bottom: 1px solid #AAAAAA;&amp;quot; | Use to make mirrors&lt;br /&gt;
|-&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; style=&amp;quot;border-bottom: 1px solid #AAAAAA; background: #F0F0F0;&amp;quot; | noFog&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; style=&amp;quot;border-bottom: 1px solid #AAAAAA;&amp;quot; | Don't fog this surface&lt;br /&gt;
|-&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; style=&amp;quot;border-bottom: 1px solid #AAAAAA; background: #F0F0F0;&amp;quot; | unsmoothedTangents&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; style=&amp;quot;border-bottom: 1px solid #AAAAAA;&amp;quot; | Uses the single largest area triangle for each vertex, instead of smoothing all&lt;br /&gt;
|-&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; style=&amp;quot;border-bottom: 1px solid #AAAAAA; background: #F0F0F0;&amp;quot; | guisurf &amp;lt;guifile&amp;gt;&lt;br /&gt;
guisurf entity[2|3]&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; style=&amp;quot;border-bottom: 1px solid #AAAAAA;&amp;quot; | This surface has a gui on it. Use &amp;quot;somegui.gui&amp;quot; to specify the gui, or entity, entity2, entity3, etc for the level designer to set it in Radiant.&lt;br /&gt;
|-&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; style=&amp;quot;border-bottom: 1px solid #AAAAAA; background: #F0F0F0;&amp;quot; | sort &amp;lt;type&amp;gt;&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; style=&amp;quot;border-bottom: 1px solid #AAAAAA;&amp;quot; | Type is one of: subview, opaque, decal, far, medium, close, almostNearest, nearest, postProcess&lt;br /&gt;
|-&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; style=&amp;quot;border-bottom: 1px solid #AAAAAA; background: #F0F0F0;&amp;quot; | spectrum &amp;lt;int&amp;gt;&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; style=&amp;quot;border-bottom: 1px solid #AAAAAA;&amp;quot; | Spectrums are used for &amp;quot;invisible writing&amp;quot; that can only be illuminated by a light of matching spectrum &lt;br /&gt;
|-&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; style=&amp;quot;border-bottom: 1px solid #AAAAAA; background: #F0F0F0;&amp;quot; | deform &amp;lt;type&amp;gt;&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; style=&amp;quot;border-bottom: 1px solid #AAAAAA;&amp;quot; | Type is one of: sprite, tube, flare, expand, move, turbulent, eyeBall, particle, particle2&lt;br /&gt;
|-&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; style=&amp;quot;border-bottom: 1px solid #AAAAAA; background: #F0F0F0;&amp;quot; | decalInfo &amp;lt;staySeconds&amp;gt;&lt;br /&gt;
&amp;lt;fadeSeconds&amp;gt; [start rgb] [end rgb]&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; style=&amp;quot;border-bottom: 1px solid #AAAAAA;&amp;quot; | Used in decal materials to set how long the decal stays, and how it fades out.&lt;br /&gt;
|-&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; style=&amp;quot;border-bottom: 1px solid #AAAAAA; background: #F0F0F0;&amp;quot; | renderbump &amp;lt;args...&amp;gt;&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; style=&amp;quot;border-bottom: 1px solid #AAAAAA;&amp;quot; | Renderbump command options, without &amp;quot;renderbump&amp;quot; at the start&lt;br /&gt;
|-&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; style=&amp;quot;border-bottom: 1px solid #AAAAAA; background: #F0F0F0;&amp;quot; | diffusemap &amp;lt;map&amp;gt;&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; style=&amp;quot;border-bottom: 1px solid #AAAAAA;&amp;quot; | shortcut for&lt;br /&gt;
 {  &lt;br /&gt;
    blend diffusemap&lt;br /&gt;
    map &amp;lt;map&amp;gt;&lt;br /&gt;
 }&lt;br /&gt;
|-&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; style=&amp;quot;border-bottom: 1px solid #AAAAAA; background: #F0F0F0;&amp;quot; | specularmap &amp;lt;map&amp;gt;&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; style=&amp;quot;border-bottom: 1px solid #AAAAAA;&amp;quot; | shortcut for &lt;br /&gt;
 {  &lt;br /&gt;
    blend specularmap  &lt;br /&gt;
    map &amp;lt;map&amp;gt;&lt;br /&gt;
 }&lt;br /&gt;
|-&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; style=&amp;quot;border-bottom: 1px solid #AAAAAA; background: #F0F0F0;&amp;quot; | bumpmap &amp;lt;map&amp;gt;&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; style=&amp;quot;border-bottom: 1px solid #AAAAAA;&amp;quot; | shortcut for &lt;br /&gt;
 {&lt;br /&gt;
    blend bumpmap&lt;br /&gt;
    map &amp;lt;map&amp;gt;&lt;br /&gt;
 }&lt;br /&gt;
|-&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; style=&amp;quot;background: #F0F0F0;&amp;quot; | DECAL_MACRO&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; | shortcut for &lt;br /&gt;
 polygonOffset 1&lt;br /&gt;
 discrete&lt;br /&gt;
 sort decal&lt;br /&gt;
 noShadows&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Global Keywords for light materials ===&lt;br /&gt;
&amp;lt;table border = 1&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;noShadows&amp;lt;/td&amp;gt; &lt;br /&gt;
&amp;lt;td&amp;gt;This light doesn't cast shadows&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt; &lt;br /&gt;
&amp;lt;td&amp;gt;forceShadows&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;fog, blend, and ambient lights don't cast shadows by default. This forces them to cast shadows&amp;lt;/td&amp;gt; &lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt; &lt;br /&gt;
&amp;lt;td&amp;gt;noPortalFog&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;This fog volume won't ever consider a portal fogged out&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt; &lt;br /&gt;
&amp;lt;td&amp;gt;fogLight&amp;lt;/td&amp;gt; &lt;br /&gt;
&amp;lt;td&amp;gt;Option to fill with fog from viewer instead of light from center&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;  &lt;br /&gt;
&amp;lt;td&amp;gt;blendLight&amp;lt;/td&amp;gt; &lt;br /&gt;
&amp;lt;td&amp;gt;Perform simple blending of the projection, instead of interacting with bumps and textures&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;  &lt;br /&gt;
&amp;lt;td&amp;gt;ambientLight&amp;lt;/td&amp;gt; &amp;lt;td&amp;gt;An ambient light has non-directional bump mapping and no specular&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;  &lt;br /&gt;
&amp;lt;td&amp;gt;lightFalloffImage &amp;lt;map&amp;gt; &amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;specifies the image to use for the third axis of projected light volumes&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Global Surface Parameters ===&lt;br /&gt;
solid may need to override a clearSolid &lt;br /&gt;
water used for water &lt;br /&gt;
playerclip solid to players &lt;br /&gt;
monsterclip solid to monsters &lt;br /&gt;
moveableclip solid to moveable entities &lt;br /&gt;
ikclip solid to IK &lt;br /&gt;
blood used to detect blood decals &lt;br /&gt;
trigger used for triggers &lt;br /&gt;
aassolid solid for AAS &lt;br /&gt;
aasobstacle used to compile an obstacle into AAS that can be enabled/disabled &lt;br /&gt;
flashlight_trigger used for triggers that are activated by the flashlight &lt;br /&gt;
nonsolid clears the solid flag &lt;br /&gt;
nullNormal renderbump will draw as 0x80 0x80 0x80, which won't collect light from any angle &lt;br /&gt;
areaportal divides areas &lt;br /&gt;
qer_nocarve don't cut brushes in editor &lt;br /&gt;
discrete surfaces should not be automatically merged together or clipped to the world, because they represent discrete objects like gui shaders mirrors, or autosprites &lt;br /&gt;
noFragment dmap won't cut surface at each bsp boundary &lt;br /&gt;
slick affects game physics (not implemented?) &lt;br /&gt;
collision collision surface. if a model has no collision surfaces, then all surfaces are considered collision surfaces &lt;br /&gt;
noimpact don't make impact explosions or marks &lt;br /&gt;
nodamage no falling damage when hitting &lt;br /&gt;
ladder player can climb up this surface &lt;br /&gt;
nosteps no footstep sounds &lt;br /&gt;
metal metal &lt;br /&gt;
stone stone &lt;br /&gt;
flesh flesh &lt;br /&gt;
wood wood &lt;br /&gt;
cardboard cardboard &lt;br /&gt;
liquid liquid &lt;br /&gt;
glass glass &lt;br /&gt;
plastic plastic &lt;br /&gt;
ricochet behaves like metal but causes a ricochet sound &lt;br /&gt;
surftype10 not used &lt;br /&gt;
surftype11 &lt;br /&gt;
surftype12 &lt;br /&gt;
surftype13 &lt;br /&gt;
surftype14 &lt;br /&gt;
surftype15 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Stage Keywords ===&lt;br /&gt;
blend &amp;lt;type&amp;gt;&lt;br /&gt;
blend &amp;lt;src&amp;gt;, &amp;lt;dst&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Blend types: Type Src Dst &lt;br /&gt;
 blend gl_src_alpha gl_one_minus_src_alpha &lt;br /&gt;
 add gl_one gl_one &lt;br /&gt;
 filter gl_dst_color gl_zero &lt;br /&gt;
 modulate gl_dst_color gl_zero &lt;br /&gt;
 none gl_zero gl_one &lt;br /&gt;
 bumpmap Normal map &lt;br /&gt;
 diffusemap Diffuse map &lt;br /&gt;
 specularmap Specular map &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Source blend modes: gl_one Constant 1 &lt;br /&gt;
 gl_zero Constant 0 &lt;br /&gt;
 gl_dst_color The color currently on the screen &lt;br /&gt;
 gl_one_minus_dst_color One minus the color currently on the screen &lt;br /&gt;
 gl_src_alpha The alpha channel of the source image &lt;br /&gt;
 gl_one_minus_src_alpha One minus the alpha channel of the source image &lt;br /&gt;
 gl_dst_alpha The alpha channel of the screen image &lt;br /&gt;
 gl_one_minus_dst_alpha One minus the alpha channel of the screen image &lt;br /&gt;
 gl_src_alpha_saturate Minimum of the source alpha and one minus screen alpha &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Destination blend modes: gl_one Constant 1 &lt;br /&gt;
 gl_zero Constant 0 &lt;br /&gt;
 gl_src_color The color of the source image &lt;br /&gt;
 gl_one_minus_src_color One minus the color of the source image &lt;br /&gt;
 gl_src_alpha The alpha channel of the source image &lt;br /&gt;
 gl_one_minus_src_alpha One minus the alpha channel of the source image &lt;br /&gt;
 gl_dst_alpha The alpha channel of the screen image &lt;br /&gt;
 gl_one_minus_dst_alpha One minus the alpha channel of the screen image &lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
map &amp;lt;map&amp;gt; The image program to use for this stage &lt;br /&gt;
remoteRenderMap &amp;lt;int&amp;gt; &amp;lt;int&amp;gt; Width and Height of the buffer to render a remote image in to (for cameras). The entity this material is applied to has to support remote render views. &lt;br /&gt;
mirrorRenderMap &amp;lt;int&amp;gt; &amp;lt;int&amp;gt; Width and Height of the buffer to render a mirror in to. This of course makes this stage a mirror stage, which is different from using the 'mirror' global keyword because that makes the entire material a mirror, rather than just one stage. &lt;br /&gt;
videomap [loop] &amp;lt;file&amp;gt; This stage uses a video stream as an image map &lt;br /&gt;
soundmap [waveform] This stage uses a sound meter from the sound system as an image map. Specify 'waveform' to get a scope rather than bars. &lt;br /&gt;
cubeMap &amp;lt;map&amp;gt; This stage uses a cube map as the image map. Looks for _px, _py, _pz, _nx, _ny, _nz for the positive x, y, z, and negative x, y, z sides &lt;br /&gt;
cameraCubeMap &amp;lt;map&amp;gt; This stage uses a cube map in camera space. Looks for _forward, _back, _left, _right, _up, and _down &lt;br /&gt;
ignoreAlphaTest Always use DEPTHFUNC_LEQUAL rather than DEPTHFUNC_EQUAL which is normally used for opaque and alpha tested surfaces &lt;br /&gt;
nearest Use nearest texture filtering &lt;br /&gt;
linear Use linear texture filtering &lt;br /&gt;
clamp Same as the global keywords. Use to override a global clamp for a specific stage. &lt;br /&gt;
zeroclamp &lt;br /&gt;
alphazeroclamp &lt;br /&gt;
noclamp Use to set texture repeat for a stage when global clamp is set &lt;br /&gt;
uncompressed Do not compress this image in medium quality mode &lt;br /&gt;
highquality &lt;br /&gt;
forceHighQuality Do not compress this image in low quality mode &lt;br /&gt;
nopicmip Ignore the image_downSize cvar &lt;br /&gt;
vertexColor Multiply the pixel color by the vertex color &lt;br /&gt;
inverseVertexColor Multiply the pixel color by one minus the vertex color &lt;br /&gt;
privatePolygonOffset &amp;lt;float&amp;gt; Explict larger (or negative) polygon offset for this stage &lt;br /&gt;
texGen &amp;lt;type&amp;gt; Type is one of: normal, reflect, skybox, wobbleSky &amp;lt;exp&amp;gt; &amp;lt;exp&amp;gt; &amp;lt;exp&amp;gt; &lt;br /&gt;
scroll &amp;lt;exp&amp;gt;, &amp;lt;exp&amp;gt; Scroll the texture coordinates &lt;br /&gt;
translate &amp;lt;exp&amp;gt;, &amp;lt;exp&amp;gt; &lt;br /&gt;
scale &amp;lt;exp&amp;gt;, &amp;lt;exp&amp;gt; Just scales without a centering &lt;br /&gt;
centerScale &amp;lt;exp&amp;gt;, &amp;lt;exp&amp;gt; Subtracts 0.5, then scales, then adds 0.5 &lt;br /&gt;
shear &amp;lt;exp&amp;gt;, &amp;lt;exp&amp;gt; Subtracts 0.5, then shears, then adds 0.5 &lt;br /&gt;
rotate &amp;lt;exp&amp;gt; Subtracts 0.5, then rotates, then adds 0.5 &lt;br /&gt;
maskRed Don't write to the red channel &lt;br /&gt;
maskGreen Don't write to the blue channel &lt;br /&gt;
maskBlue Don't write to the green channel &lt;br /&gt;
maskAlpha Don't write to the alpha channel &lt;br /&gt;
maskColor Shortcut for &lt;br /&gt;
maskRedmaskGreenmaskBlue &lt;br /&gt;
maskDepth Don't write to the depth buffer &lt;br /&gt;
alphaTest &amp;lt;exp&amp;gt; Only write if the alpha value is greater than &amp;lt;exp&amp;gt; &lt;br /&gt;
red &amp;lt;exp&amp;gt; Set the red vertex color &lt;br /&gt;
green &amp;lt;exp&amp;gt; Set the green vertex color &lt;br /&gt;
blue &amp;lt;exp&amp;gt; Set the blue vertex color &lt;br /&gt;
alpha &amp;lt;exp&amp;gt; Set the alpha vertex value &lt;br /&gt;
rgb &amp;lt;exp&amp;gt; Shortcut for &lt;br /&gt;
red &amp;lt;exp&amp;gt;green &amp;lt;exp&amp;gt;blue &amp;lt;exp&amp;gt; &lt;br /&gt;
rgba &amp;lt;exp&amp;gt; Shortcut for &lt;br /&gt;
red &amp;lt;exp&amp;gt;green &amp;lt;exp&amp;gt;blue &amp;lt;exp&amp;gt;alpha &amp;lt;exp&amp;gt; &lt;br /&gt;
color &amp;lt;exp0&amp;gt;, &amp;lt;exp1&amp;gt;, &amp;lt;exp2&amp;gt;, &amp;lt;exp3&amp;gt; Shortcut for &lt;br /&gt;
red exp0green exp1blue exp2alpha exp3 &lt;br /&gt;
colored Shortcut for &lt;br /&gt;
color parm0, parm1, parm2, parm3 &lt;br /&gt;
if &amp;lt;exp&amp;gt; Conditionally disable stages &lt;br /&gt;
fragmentProgram &amp;lt;prog&amp;gt; Use an ARB fragment program with this stage &lt;br /&gt;
vertexProgram &amp;lt;prog&amp;gt; Use an ARB vertex program with this stage &lt;br /&gt;
program &amp;lt;prog&amp;gt; Shortcut for &lt;br /&gt;
fragmentProgram &amp;lt;prog&amp;gt;vertexProgram &amp;lt;prog&amp;gt; &lt;br /&gt;
vertexParm &amp;lt;index&amp;gt; &amp;lt;exp0&amp;gt;&lt;br /&gt;
[,exp1] [,exp2] [,exp3] Values to pass to the vertex program. One expression gets repeated across all 4 values. Two expressions put 0, 1 in z, w. Three expressions put 1 in w. &lt;br /&gt;
fragmentMap &amp;lt;index&amp;gt; [options] &amp;lt;map&amp;gt; The image map to use for texture unit &amp;lt;index&amp;gt;&lt;br /&gt;
[options] can be cubeMap, cameraCubeMap, nearest, linear, clamp, noclamp, zeroclamp, alphazeroclamp, forceHighQuality, uncompressed, highquality, or nopicmip &lt;br /&gt;
megaTexture &amp;lt;mega&amp;gt; This stage uses a mega texture (super secret)&lt;br /&gt;
&lt;br /&gt;
=== Parameters Key ===&lt;br /&gt;
&amp;lt;float&amp;gt; Any number &lt;br /&gt;
&amp;lt;int&amp;gt; Any number without a fractional part &lt;br /&gt;
&amp;lt;string&amp;gt; Any value enclosed in quotes &lt;br /&gt;
&amp;lt;index&amp;gt; An integer number that is an index into an array &lt;br /&gt;
&amp;lt;map&amp;gt; An image map, which may include image programs (below) &lt;br /&gt;
&amp;lt;prog&amp;gt; A vertex / frament program. Written using the GL ARB shader language. These files are stored in the glprogs directory &lt;br /&gt;
&amp;lt;exp&amp;gt; An expression that is evaluated every frame. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Image Program Functions ===&lt;br /&gt;
These can be used anywhere that accepts &amp;lt;map&amp;gt; and can be nested heightmap(&amp;lt;map&amp;gt;, &amp;lt;float&amp;gt;) Turns a grayscale height map into a normal map. &amp;lt;float&amp;gt; varies the bumpiness &lt;br /&gt;
addnormals(&amp;lt;map&amp;gt;, &amp;lt;map&amp;gt;) Adds two normal maps together. Result is normalized. &lt;br /&gt;
smoothnormals(&amp;lt;map&amp;gt;) Does a box filter on the normal map, and normalizes the result. &lt;br /&gt;
add(&amp;lt;map&amp;gt;, &amp;lt;map&amp;gt;) Adds two images without normalizing the result &lt;br /&gt;
scale(&amp;lt;map&amp;gt;, &amp;lt;float&amp;gt; [,float] [,float] [,float]) Scales the RGBA by the specified factors. Defaults to 0. &lt;br /&gt;
invertAlpha(&amp;lt;map&amp;gt;) Inverts the alpha channel (0 becomes 1, 1 becomes 0) &lt;br /&gt;
invertColor(&amp;lt;map&amp;gt;) Inverts the R, G, and B channels &lt;br /&gt;
makeIntensity(&amp;lt;map&amp;gt;) Copies the red channel to the G, B, and A channels &lt;br /&gt;
makeAlpha(&amp;lt;map&amp;gt;) Sets the alpha channel to an average of the RGB channels. Sets the RGB channels to white.&lt;/div&gt;</summary>
		<author><name>MoP</name></author>
		
	</entry>
</feed>