docs: add original shaderManual
101
docs/shaderManual/alpha-channels.html
Normal file
|
|
@ -0,0 +1,101 @@
|
|||
<?xml version="1.1" encoding="iso-8859-1"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
|
||||
<head>
|
||||
<title>Q3Map2 Shader Manual</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||
<meta name="keywords" content="id software, quake, radiant, qeradiant, gtkradiant, q3map, q3map2, shader, manual, ydnar, obsidian" />
|
||||
<meta name="description" content="Q3Map2 Shader Manual" />
|
||||
<meta name="copyright" content="Obsidian © 2010" />
|
||||
<link rel="stylesheet" href="default.css" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/_css/default.css" type="text/css" media="all" title="Default styles" />
|
||||
</head>
|
||||
<body id="article_alpha_channel">
|
||||
|
||||
<div id="nav">
|
||||
<div id="navbutton">
|
||||
<ul>
|
||||
<div id="navtop"></div>
|
||||
<li><a href="index.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/index.html">Q3Map2 Shader Manual</a></li>
|
||||
<li><a href="contents.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/contents.html">Full Contents</a></li>
|
||||
<li>Introduction
|
||||
<ul>
|
||||
<li><a href="preface.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/preface.html">Preface</a></li>
|
||||
<li><a href="shader-concepts.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/shader-concepts.html">Shader Concepts</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Directives
|
||||
<ul>
|
||||
<li><a href="general-directives.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/general-directives.html">General Directives</a></li>
|
||||
<li><a href="q3map-global-directives.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-global-directives.html">Q3Map Global Directives</a></li>
|
||||
<li><a href="q3map-surface-parameter-directives.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-surface-parameter-directives.html">Q3Map Surface Parameter Directives</a></li>
|
||||
<li><a href="quake-editor-radiant-directives.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/quake-editor-radiant-directives.html">Quake Editor Radiant Directives</a></li>
|
||||
<li><a href="stage-directives.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/stage-directives.html">Stage Directives</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Articles
|
||||
<ul>
|
||||
<li><a href="texture-creation.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/texture-creation.html">Texture Creation</a></li>
|
||||
<li><a href="alpha-channels.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/alpha-channels.html">Alpha Channels</a></li>
|
||||
<li><a href="light-emitting-shaders.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/light-emitting-shaders.html">Light Emitting Shaders</a></li>
|
||||
<li><a href="lightstyles.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/lightstyles.html">Lightstyles</a></li>
|
||||
<li><a href="cel-shading.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/cel-shading.html">Cel Shading</a></li>
|
||||
<li><a href="decal-tricks.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/decal-tricks.html">Decal Tricks</a></li>
|
||||
<li><a href="foghull.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/foghull.html">Foghull</a></li>
|
||||
<li><a href="fur.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/fur.html">Fur</a></li>
|
||||
<li><a href="terrain-and-alphamod-blends.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/terrain-and-alphamod-blends.html">Terrain and alphaMod Blends</a></li>
|
||||
<li><a href="triggerable-shader-entities.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/triggerable-shader-entities.html">Triggerable Shader Entities</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<div id="navlow"></div>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h1>Alpha Channels</h1>
|
||||
|
||||
<p>To use some blend modes of alphaFunc, you must add an alpha channel to your texture files. Photoshop can do this. Paintshop Pro has the ability to make an alpha channel but cannot work directly in to it. In Photoshop you want to set the type to Mask. Black has a value of 255. White has a value of 0. The darkness of a pixel's alpha value determines the transparency of the corresponding RGB value in the game world. Darker = more transparent.</p>
|
||||
|
||||
<p>Care must be taken when reworking textures with alpha channels. Textures without alpha channels are saved as 24 bit images while textures with alpha channels are saved as 32 bit. If you save them out as 24 bit, the alpha channel is erased. Note: Adobe Photoshop will prompt you to save as 32, 24 or 16 bit. Choose wisely. If you save a texture as 32 bit and you don't actually have anything in the alpha channel, Quake III Arena may still be forced to use a lower quality texture format (when in 16 bit rendering) than if you had saved it as 24 bit.</p>
|
||||
|
||||
<p>To create a texture that has "open" areas, make those areas black in the alpha channel and make white the areas that are to be opaque. Using gray shades can create varying degrees of opacity/transparency.</p>
|
||||
|
||||
<pre>
|
||||
// Opaque texture with see-through holes knocked in in.
|
||||
textures/base_floor/pjgrate1
|
||||
{
|
||||
surfaceparm metalsteps
|
||||
cull none
|
||||
|
||||
// A GRATE OR GRILL THAT CAN BE SEEN FROM BOTH SIDES
|
||||
{
|
||||
map textures/base_floor/pjgrate1.tga
|
||||
blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
|
||||
alphaFunc GT0
|
||||
depthWrite
|
||||
rgbGen identity
|
||||
}
|
||||
{
|
||||
map $lightmap
|
||||
rgbGen identity
|
||||
blendFunc GL_DST_COLOR GL_ZERO
|
||||
depthFunc equal
|
||||
}
|
||||
}
|
||||
</pre>
|
||||
|
||||
<p>The alpha channel can also be used to merge a texture (including one that contains black) into another image so that the merged art appears to be and opaque decal on a solid surface (unaffected by the surface it appears to sit on), without actually using an alpha function. The following is a very simple example:</p>
|
||||
|
||||
<img src="alphachannel01.jpg" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/_images/alphachannel01.jpg" class="center" />
|
||||
|
||||
<p>Start with a TGA file image. In this case, a pentagram on a plain white field (figure 1A). The color of the field surrrounding the image to be merged is not relevant to this process (although having a hard-edged break between the image to be isolated and the field makes the mask making process easier). Make an alpha channel. The area of the image to be merged with another image is masked off in white. The area to be masked out (notused) is pure black (figure 1B). The image to be merged into is greenfloor.tga (figure 1C).</p>
|
||||
|
||||
<p>Make a qer_editorimage of greenfloor.tga. This is placed in the frame buffer as the map image for the texture. By using GL_SRC_ALPHA as the source part of the blend equation, the shader adds in only the non-black parts of the pentagram. Using GL_MINUS_ONE_SRC_ALPHA, the shader inverts the pentagram's alpha channel and adds in only the non-black parts of the green floor.</p>
|
||||
|
||||
<p>In a like manner, the alpha channel can be used to blend the textures more evenly. A simple experiment involves using a linear gradiant in the alpha channel (white to black) and merging two textures so they appear to cross fade into each other.</p>
|
||||
|
||||
<p>A more complicated experiment would be to take the pentagram in the first example and give it an aliased edge so that the pentagram appeared to fade or blend into the floor. </p>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
BIN
docs/shaderManual/alphachannel01.jpg
Normal file
|
After Width: | Height: | Size: 26 KiB |
BIN
docs/shaderManual/antiportal_sm.jpg
Normal file
|
After Width: | Height: | Size: 73 KiB |
98
docs/shaderManual/cel-shading.html
Normal file
|
|
@ -0,0 +1,98 @@
|
|||
<?xml version="1.1" encoding="iso-8859-1"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
|
||||
<head>
|
||||
<title>Q3Map2 Shader Manual</title>
|
||||
<meta name="keywords" content="id software, quake, radiant, qeradiant, gtkradiant, q3map, q3map2, shader, manual, ydnar, obsidian" />
|
||||
<meta name="description" content="Q3Map2 Shader Manual" />
|
||||
<meta name="copyright" content="Obsidian © 2010" />
|
||||
<link rel="stylesheet" href="default.css" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/_css/default.css" type="text/css" media="all" title="Default styles" />
|
||||
</head>
|
||||
<body id="articles">
|
||||
|
||||
<div id="nav">
|
||||
<div id="navbutton">
|
||||
<ul>
|
||||
<div id="navtop"></div>
|
||||
<li><a href="index.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/index.html">Q3Map2 Shader Manual</a></li>
|
||||
<li><a href="contents.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/contents.html">Full Contents</a></li>
|
||||
<li>Introduction
|
||||
<ul>
|
||||
<li><a href="preface.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/preface.html">Preface</a></li>
|
||||
<li><a href="shader-concepts.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/shader-concepts.html">Shader Concepts</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Directives
|
||||
<ul>
|
||||
<li><a href="general-directives.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/general-directives.html">General Directives</a></li>
|
||||
<li><a href="q3map-global-directives.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-global-directives.html">Q3Map Global Directives</a></li>
|
||||
<li><a href="q3map-surface-parameter-directives.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-surface-parameter-directives.html">Q3Map Surface Parameter Directives</a></li>
|
||||
<li><a href="quake-editor-radiant-directives.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/quake-editor-radiant-directives.html">Quake Editor Radiant Directives</a></li>
|
||||
<li><a href="stage-directives.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/stage-directives.html">Stage Directives</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Articles
|
||||
<ul>
|
||||
<li><a href="texture-creation.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/texture-creation.html">Texture Creation</a></li>
|
||||
<li><a href="alpha-channels.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/alpha-channels.html">Alpha Channels</a></li>
|
||||
<li><a href="light-emitting-shaders.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/light-emitting-shaders.html">Light Emitting Shaders</a></li>
|
||||
<li><a href="lightstyles.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/lightstyles.html">Lightstyles</a></li>
|
||||
<li><a href="cel-shading.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/cel-shading.html">Cel Shading</a></li>
|
||||
<li><a href="decal-tricks.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/decal-tricks.html">Decal Tricks</a></li>
|
||||
<li><a href="foghull.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/foghull.html">Foghull</a></li>
|
||||
<li><a href="fur.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/fur.html">Fur</a></li>
|
||||
<li><a href="terrain-and-alphamod-blends.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/terrain-and-alphamod-blends.html">Terrain and alphaMod Blends</a></li>
|
||||
<li><a href="triggerable-shader-entities.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/triggerable-shader-entities.html">Triggerable Shader Entities</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<div id="navlow"></div>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h1>Cel Shading</h1>
|
||||
|
||||
<p>Cel shading is the technique used to make your maps render like cartoons, with black (or other color) solid outlines tracing hard edges.</p>
|
||||
|
||||
In order for celshading to work properly, you must use -meta when compiling the BSP.
|
||||
The funny little nonplanar/shadeangle/invert/offset nonsense in cel.shader is what makes it work properly.
|
||||
You'll know when it's working when it starts taking about 10-20x as long to make the BSP.
|
||||
|
||||
<pre>
|
||||
// ink shader for maps
|
||||
// to use, add "cel" to shaderlist.txt
|
||||
// add a "_celshader" key to worldspawn entity with a value of "cel/ink"
|
||||
|
||||
textures/cel/ink
|
||||
{
|
||||
qer_editorimage gfx/colors/black.tga
|
||||
|
||||
q3map_notjunc
|
||||
q3map_nonplanar
|
||||
q3map_bounce 0.0
|
||||
q3map_shadeangle 120
|
||||
q3map_texturesize 1 1
|
||||
q3map_invert //inverts drawing surface for backfacing hull
|
||||
q3map_offset -2.0 //offsets surface by the specified distance
|
||||
|
||||
surfaceparm nolightmap
|
||||
surfaceparm trans
|
||||
surfaceparm nonsolid
|
||||
surfaceparm nomarks
|
||||
|
||||
sort 16
|
||||
|
||||
{
|
||||
map gfx/colors/black.tga
|
||||
rgbGen identity
|
||||
}
|
||||
}
|
||||
</pre>
|
||||
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
BIN
docs/shaderManual/clampmap.jpg
Normal file
|
After Width: | Height: | Size: 5.4 KiB |
276
docs/shaderManual/contents.html
Normal file
|
|
@ -0,0 +1,276 @@
|
|||
<?xml version="1.1" encoding="iso-8859-1"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
|
||||
<head>
|
||||
<title>Q3Map2 Shader Manual</title>
|
||||
<meta name="keywords" content="id software, quake, radiant, qeradiant, gtkradiant, q3map, q3map2, shader, manual, ydnar, obsidian" />
|
||||
<meta name="description" content="Q3Map2 Shader Manual" />
|
||||
<meta name="copyright" content="Obsidian © 2010" />
|
||||
<link rel="stylesheet" href="default.css" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/_css/default.css" type="text/css" media="all" title="Default styles" />
|
||||
</head>
|
||||
<body id="contents">
|
||||
|
||||
<div id="nav">
|
||||
<div id="navbutton">
|
||||
<ul>
|
||||
<div id="navtop"></div>
|
||||
<li><a href="index.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/index.html">Q3Map2 Shader Manual</a></li>
|
||||
<li><a href="contents.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/contents.html">Full Contents</a></li>
|
||||
<li>Introduction
|
||||
<ul>
|
||||
<li><a href="preface.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/preface.html">Preface</a></li>
|
||||
<li><a href="shader-concepts.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/shader-concepts.html">Shader Concepts</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Directives
|
||||
<ul>
|
||||
<li><a href="general-directives.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/general-directives.html">General Directives</a></li>
|
||||
<li><a href="q3map-global-directives.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-global-directives.html">Q3Map Global Directives</a></li>
|
||||
<li><a href="q3map-surface-parameter-directives.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-surface-parameter-directives.html">Q3Map Surface Parameter Directives</a></li>
|
||||
<li><a href="quake-editor-radiant-directives.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/quake-editor-radiant-directives.html">Quake Editor Radiant Directives</a></li>
|
||||
<li><a href="stage-directives.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/stage-directives.html">Stage Directives</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Articles
|
||||
<ul>
|
||||
<li><a href="texture-creation.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/texture-creation.html">Texture Creation</a></li>
|
||||
<li><a href="alpha-channels.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/alpha-channels.html">Alpha Channels</a></li>
|
||||
<li><a href="light-emitting-shaders.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/light-emitting-shaders.html">Light Emitting Shaders</a></li>
|
||||
<li><a href="lightstyles.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/lightstyles.html">Lightstyles</a></li>
|
||||
<li><a href="cel-shading.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/cel-shading.html">Cel Shading</a></li>
|
||||
<li><a href="decal-tricks.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/decal-tricks.html">Decal Tricks</a></li>
|
||||
<li><a href="foghull.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/foghull.html">Foghull</a></li>
|
||||
<li><a href="fur.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/fur.html">Fur</a></li>
|
||||
<li><a href="terrain-and-alphamod-blends.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/terrain-and-alphamod-blends.html">Terrain and alphaMod Blends</a></li>
|
||||
<li><a href="triggerable-shader-entities.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/triggerable-shader-entities.html">Triggerable Shader Entities</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<div id="navlow"></div>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h1>Contents</h1>
|
||||
|
||||
<ul>
|
||||
<li><h3>Introduction</h3>
|
||||
<ul>
|
||||
<li><a href="preface.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/preface.html">Preface</a>
|
||||
<ul>
|
||||
<li><a href="preface.html#q3map2edition" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/preface.html#q3map2edition">The Q3Map2 Edition</a></li>
|
||||
<li><a href="preface.html#usingthemanual" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/preface.html#usingthemanual">Using the Manual</a></li>
|
||||
<li><a href="preface.html#credits" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/preface.html#credits">Credits</a></li>
|
||||
<li><a href="preface.html#contact" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/preface.html#contact">Contact</a></li>
|
||||
<li><a href="preface.html#legal" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/preface.html#legal">Legal</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="shader-concepts.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/shader-concepts.html">Shader Concepts</a>
|
||||
<ul>
|
||||
<li><a href="shader-concepts.html#whatisashader" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/shader-concepts.html#whatisashader">What is a Shader?</a></li>
|
||||
<li><a href="shader-concepts.html#shadername&fileconventions" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/shader-concepts.html#shadername&fileconventions">Shader Name & File Conventions</a></li>
|
||||
<li><a href="shader-concepts.html#keyconcepts" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/shader-concepts.html#keyconcepts">Key Concepts</a></li>
|
||||
<li><a href="shader-concepts.html#specialcasesyntax" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/shader-concepts.html#specialcasesyntax">Special Case Syntax (Comments & :q3map Suffix)</a></li>
|
||||
<li><a href="shader-concepts.html#directivetypes" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/shader-concepts.html#directivetypes">Directive Types</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li><!-- end Introduction -->
|
||||
<li><h3>Directives</h3>
|
||||
<ul>
|
||||
<li><a href="general-directives.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/general-directives.html">General Directives</a>
|
||||
<ul>
|
||||
<li><a href="general-directives.html#skyParms" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/general-directives.html#skyParms">skyParms</a></li>
|
||||
<li><a href="general-directives.html#cull" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/general-directives.html#cull">cull</a></li>
|
||||
<li><a href="general-directives.html#deformVertexes" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/general-directives.html#deformVertexes">deformVertexes</a></li>
|
||||
<li><a href="general-directives.html#fogParms" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/general-directives.html#fogParms">fogParms</a></li>
|
||||
<li><a href="general-directives.html#noPicMip" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/general-directives.html#noPicMip">noPicMip</a></li>
|
||||
<li><a href="general-directives.html#noMipMaps" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/general-directives.html#noMipMaps">noMipMaps</a></li>
|
||||
<li><a href="general-directives.html#polygonOffset" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/general-directives.html#polygonOffset">polygonOffset</a></li>
|
||||
<li><a href="general-directives.html#portal" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/general-directives.html#portal">portal</a></li>
|
||||
<li><a href="general-directives.html#sort" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/general-directives.html#sort">sort</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="q3map-global-directives.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-global-directives.html">Q3Map Global Directives</a>
|
||||
<ul>
|
||||
<li><a href="q3map-global-directives.html#q3map_alphaGen" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-global-directives.html#q3map_alphaGen">q3map_alphaGen</a></li>
|
||||
<li><a href="q3map-global-directives.html#q3map_alphaMod" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-global-directives.html#q3map_alphaMod">q3map_alphaMod</a></li>
|
||||
<li><a href="q3map-global-directives.html#q3map_backShader" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-global-directives.html#q3map_backShader">q3map_backShader</a></li>
|
||||
<li><a href="q3map-global-directives.html#q3map_backSplash" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-global-directives.html#q3map_backSplash">q3map_backSplash</a></li>
|
||||
<li><a href="q3map-global-directives.html#q3map_baseShader" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-global-directives.html#q3map_baseShader">q3map_baseShader</a></li>
|
||||
<li><a href="q3map-global-directives.html#q3map_bounce" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-global-directives.html#q3map_bounce">q3map_bounce</a></li>
|
||||
<li><a href="q3map-global-directives.html#q3map_bounceScale" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-global-directives.html#q3map_bounceScale">q3map_bounceScale</a></li>
|
||||
<li><a href="q3map-global-directives.html#q3map_clipModel" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-global-directives.html#q3map_clipModel">q3map_clipModel</a></li>
|
||||
<li><a href="q3map-global-directives.html#q3map_cloneShader" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-global-directives.html#q3map_cloneShader">q3map_cloneShader</a></li>
|
||||
<li><a href="q3map-global-directives.html#q3map_colorGen" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-global-directives.html#q3map_colorGen">q3map_colorGen</a></li>
|
||||
<li><a href="q3map-global-directives.html#q3map_colorMod" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-global-directives.html#q3map_colorMod">q3map_colorMod</a></li>
|
||||
<!--
|
||||
<li><a href="q3map-global-directives.html#q3map_extraShader">q3map_extraShader</a></li>
|
||||
<li><a href="q3map-global-directives.html#q3map_fadeAlpha">q3map_fadeAlpha</a></li>
|
||||
-->
|
||||
<li><a href="q3map-global-directives.html#q3map_fogDir" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-global-directives.html#q3map_fogDir">q3map_fogDir</a></li>
|
||||
<li><a href="q3map-global-directives.html#q3map_forceMeta" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-global-directives.html#q3map_forceMeta">q3map_forceMeta</a></li>
|
||||
<li><a href="q3map-global-directives.html#q3map_forceSunlight" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-global-directives.html#q3map_forceSunlight">q3map_forceSunlight</a></li>
|
||||
<li><a href="q3map-global-directives.html#q3map_fur" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-global-directives.html#q3map_fur">q3map_fur</a></li>
|
||||
<li><a href="q3map-global-directives.html#q3map_globalTexture" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-global-directives.html#q3map_globalTexture">q3map_globalTexture</a></li>
|
||||
<li><a href="q3map-global-directives.html#q3map_indexed" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-global-directives.html#q3map_indexed">q3map_indexed</a></li>
|
||||
<li><a href="q3map-global-directives.html#q3map_invert" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-global-directives.html#q3map_invert">q3map_invert</a></li>
|
||||
<li><a href="q3map-global-directives.html#q3map_lightImage" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-global-directives.html#q3map_lightImage">q3map_lightImage</a></li>
|
||||
<li><a href="q3map-global-directives.html#q3map_lightmapAxis" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-global-directives.html#q3map_lightmapAxis">q3map_lightmapAxis</a></li>
|
||||
<li><a href="q3map-global-directives.html#q3map_lightmapBrightness" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-global-directives.html#q3map_lightmapBrightness">q3map_lightmapBrightness</a></li>
|
||||
<li><a href="q3map-global-directives.html#q3map_lightmapFilterRadius" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-global-directives.html#q3map_lightmapFilterRadius">q3map_lightmapFilterRadius</a></li>
|
||||
<li><a href="q3map-global-directives.html#q3map_lightmapGamma" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-global-directives.html#q3map_lightmapGamma">q3map_lightmapGamma</a></li>
|
||||
<li><a href="q3map-global-directives.html#q3map_lightmapMergable" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-global-directives.html#q3map_lightmapMergable">q3map_lightmapMergable</a></li>
|
||||
<li><a href="q3map-global-directives.html#q3map_lightmapSampleOffset" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-global-directives.html#q3map_lightmapSampleOffset">q3map_lightmapSampleOffset</a></li>
|
||||
<li><a href="q3map-global-directives.html#q3map_lightmapSampleSize" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-global-directives.html#q3map_lightmapSampleSize">q3map_lightmapSampleSize</a></li>
|
||||
<li><a href="q3map-global-directives.html#q3map_lightmapSize" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-global-directives.html#q3map_lightmapSize">q3map_lightmapSize</a></li>
|
||||
<li><a href="q3map-global-directives.html#q3map_lightRGB" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-global-directives.html#q3map_lightRGB">q3map_lightRGB</a></li>
|
||||
<li><a href="q3map-global-directives.html#q3map_lightStyle" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-global-directives.html#q3map_lightStyle">q3map_lightStyle</a></li>
|
||||
<li><a href="q3map-global-directives.html#q3map_lightSubdivide" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-global-directives.html#q3map_lightSubdivide">q3map_lightSubdivide</a></li>
|
||||
<li><a href="q3map-global-directives.html#q3map_noClip" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-global-directives.html#q3map_noClip">q3map_noClip</a></li>
|
||||
<li><a href="q3map-global-directives.html#q3map_noFast" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-global-directives.html#q3map_noFast">q3map_noFast</a></li>
|
||||
<li><a href="q3map-global-directives.html#q3map_noFog" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-global-directives.html#q3map_noFog">q3map_noFog</a></li>
|
||||
<li><a href="q3map-global-directives.html#q3map_nonPlanar" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-global-directives.html#q3map_nonPlanar">q3map_nonPlanar</a></li>
|
||||
<li><a href="q3map-global-directives.html#q3map_normalImage" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-global-directives.html#q3map_normalImage">q3map_normalImage</a></li>
|
||||
<li><a href="q3map-global-directives.html#q3map_noTJunc" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-global-directives.html#q3map_noTJunc">q3map_noTJunc</a></li>
|
||||
<li><a href="q3map-global-directives.html#q3map_noVertexLight" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-global-directives.html#q3map_noVertexLight">q3map_noVertexLight</a></li>
|
||||
<li><a href="q3map-global-directives.html#q3map_noVertexShadows" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-global-directives.html#q3map_noVertexShadows">q3map_noVertexShadows</a></li>
|
||||
<li><a href="q3map-global-directives.html#q3map_offset" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-global-directives.html#q3map_offset">q3map_offset</a></li>
|
||||
<li><a href="q3map-global-directives.html#q3map_patchShadows" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-global-directives.html#q3map_patchShadows">q3map_patchShadows</a></li>
|
||||
<li><a href="q3map-global-directives.html#q3map_remapShader" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-global-directives.html#q3map_remapShader">q3map_remapShader</a></li>
|
||||
<!--
|
||||
<li><a href="q3map-global-directives.html#q3map_replicate">q3map_replicate</a></li>
|
||||
-->
|
||||
<li><a href="q3map-global-directives.html#q3map_rgbGen" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-global-directives.html#q3map_rgbGen">q3map_rgbGen</a></li>
|
||||
<li><a href="q3map-global-directives.html#q3map_rgbMod" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-global-directives.html#q3map_rgbMod">q3map_rgbMod</a></li>
|
||||
<li><a href="q3map-global-directives.html#q3map_shadeAngle" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-global-directives.html#q3map_shadeAngle">q3map_shadeAngle</a></li>
|
||||
<li><a href="q3map-global-directives.html#q3map_skylight" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-global-directives.html#q3map_skylight">q3map_skylight</a></li>
|
||||
<li><a href="q3map-global-directives.html#q3map_splotchFix" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-global-directives.html#q3map_splotchFix">q3map_splotchFix</a></li>
|
||||
<li><a href="q3map-global-directives.html#q3map_styleMarker" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-global-directives.html#q3map_styleMarker">q3map_styleMarker</a></li>
|
||||
<li><a href="q3map-global-directives.html#q3map_styleMarker2" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-global-directives.html#q3map_styleMarker2">q3map_styleMarker2</a></li>
|
||||
<li><a href="q3map-global-directives.html#q3map_sun" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-global-directives.html#q3map_sun">q3map_sun</a></li>
|
||||
<li><a href="q3map-global-directives.html#q3map_sunExt" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-global-directives.html#q3map_sunExt">q3map_sunExt</a></li>
|
||||
<!--
|
||||
<li><a href="q3map-global-directives.html#q3map_sunlight">q3map_sunlight</a></li>
|
||||
-->
|
||||
<li><a href="q3map-global-directives.html#q3map_surfaceLight" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-global-directives.html#q3map_surfaceLight">q3map_surfaceLight</a></li>
|
||||
<li><a href="q3map-global-directives.html#q3map_surfaceModel" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-global-directives.html#q3map_surfaceModel">q3map_surfaceModel</a></li>
|
||||
<li><a href="q3map-global-directives.html#q3map_tcGen" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-global-directives.html#q3map_tcGen">q3map_tcGen</a></li>
|
||||
<li><a href="q3map-global-directives.html#q3map_tcMod" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-global-directives.html#q3map_tcMod">q3map_tcMod</a></li>
|
||||
<li><a href="q3map-global-directives.html#q3map_terrain" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-global-directives.html#q3map_terrain">q3map_terrain</a></li>
|
||||
<li><a href="q3map-global-directives.html#q3map_tessSize" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-global-directives.html#q3map_tessSize">q3map_tessSize</a></li>
|
||||
<li><a href="q3map-global-directives.html#q3map_textureSize" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-global-directives.html#q3map_textureSize">q3map_textureSize</a></li>
|
||||
<li><a href="q3map-global-directives.html#q3map_traceLight" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-global-directives.html#q3map_traceLight">q3map_traceLight</a></li>
|
||||
<li><a href="q3map-global-directives.html#q3map_vertexScale" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-global-directives.html#q3map_vertexScale">q3map_vertexScale</a></li>
|
||||
<li><a href="q3map-global-directives.html#q3map_vertexShadows" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-global-directives.html#q3map_vertexShadows">q3map_vertexShadows</a></li>
|
||||
<li><a href="q3map-global-directives.html#q3map_vlight" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-global-directives.html#q3map_vlight">q3map_vlight</a></li>
|
||||
</ul>
|
||||
</li><!-- end Q3Map Global Directives -->
|
||||
<li><a href="q3map-surface-parameter-directives.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-surface-parameter-directives.html">Q3Map Surface Parameter Directives</a>
|
||||
<ul>
|
||||
<li><a href="q3map-surface-parameter-directives.html#alphashadow" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-surface-parameter-directives.html#alphashadow">surfaceparm alphashadow</a></li>
|
||||
<li><a href="q3map-surface-parameter-directives.html#antiportal" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-surface-parameter-directives.html#antiportal">surfaceparm antiportal</a></li>
|
||||
<li><a href="q3map-surface-parameter-directives.html#areaportal" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-surface-parameter-directives.html#areaportal">surfaceparm areaportal</a></li>
|
||||
<li><a href="q3map-surface-parameter-directives.html#botclip" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-surface-parameter-directives.html#botclip">surfaceparm botclip</a></li>
|
||||
<li><a href="q3map-surface-parameter-directives.html#clusterportal" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-surface-parameter-directives.html#clusterportal">surfaceparm clusterportal</a></li>
|
||||
<li><a href="q3map-surface-parameter-directives.html#detail" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-surface-parameter-directives.html#detail">surfaceparm detail</a></li>
|
||||
<li><a href="q3map-surface-parameter-directives.html#donotenter" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-surface-parameter-directives.html#donotenter">surfaceparm donotenter</a></li>
|
||||
<li><a href="q3map-surface-parameter-directives.html#dust" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-surface-parameter-directives.html#dust">surfaceparm dust</a></li>
|
||||
<li><a href="q3map-surface-parameter-directives.html#flesh" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-surface-parameter-directives.html#flesh">surfaceparm flesh</a></li>
|
||||
<li><a href="q3map-surface-parameter-directives.html#fog" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-surface-parameter-directives.html#fog">surfaceparm fog</a></li>
|
||||
<li><a href="q3map-surface-parameter-directives.html#hint" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-surface-parameter-directives.html#hint">surfaceparm hint</a></li>
|
||||
<li><a href="q3map-surface-parameter-directives.html#ladder" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-surface-parameter-directives.html#ladder">surfaceparm ladder</a></li>
|
||||
<li><a href="q3map-surface-parameter-directives.html#lava" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-surface-parameter-directives.html#lava">surfaceparm lava</a></li>
|
||||
<li><a href="q3map-surface-parameter-directives.html#lightfilter" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-surface-parameter-directives.html#lightfilter">surfaceparm lightfilter</a></li>
|
||||
<li><a href="q3map-surface-parameter-directives.html#lightgrid" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-surface-parameter-directives.html#lightgrid">surfaceparm lightgrid</a></li>
|
||||
<li><a href="q3map-surface-parameter-directives.html#metalsteps" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-surface-parameter-directives.html#metalsteps">surfaceparm metalsteps</a></li>
|
||||
<li><a href="q3map-surface-parameter-directives.html#monsterclip" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-surface-parameter-directives.html#monsterclip">surfaceparm monsterclip</a></li>
|
||||
<li><a href="q3map-surface-parameter-directives.html#nodamage" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-surface-parameter-directives.html#nodamage">surfaceparm nodamage</a></li>
|
||||
<li><a href="q3map-surface-parameter-directives.html#nodlight" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-surface-parameter-directives.html#nodlight">surfaceparm nodlight</a></li>
|
||||
<li><a href="q3map-surface-parameter-directives.html#nodraw" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-surface-parameter-directives.html#nodraw">surfaceparm nodraw</a></li>
|
||||
<li><a href="q3map-surface-parameter-directives.html#nodrop" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-surface-parameter-directives.html#nodrop">surfaceparm nodrop</a></li>
|
||||
<li><a href="q3map-surface-parameter-directives.html#noimpact" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-surface-parameter-directives.html#noimpact">surfaceparm noimpact</a></li>
|
||||
<li><a href="q3map-surface-parameter-directives.html#nomarks" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-surface-parameter-directives.html#nomarks">surfaceparm nomarks</a></li>
|
||||
<li><a href="q3map-surface-parameter-directives.html#nolightmap" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-surface-parameter-directives.html#nolightmap">surfaceparm nolightmap</a></li>
|
||||
<li><a href="q3map-surface-parameter-directives.html#nosteps" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-surface-parameter-directives.html#nosteps">surfaceparm nosteps</a></li>
|
||||
<li><a href="q3map-surface-parameter-directives.html#nonsolid" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-surface-parameter-directives.html#nonsolid">surfaceparm nonsolid</a></li>
|
||||
<li><a href="q3map-surface-parameter-directives.html#origin" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-surface-parameter-directives.html#origin">surfaceparm origin</a></li>
|
||||
<li><a href="q3map-surface-parameter-directives.html#playerclip" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-surface-parameter-directives.html#playerclip">surfaceparm playerclip</a></li>
|
||||
<li><a href="q3map-surface-parameter-directives.html#pointlight" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-surface-parameter-directives.html#pointlight">surfaceparm pointlight</a></li>
|
||||
<li><a href="q3map-surface-parameter-directives.html#skip" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-surface-parameter-directives.html#skip">surfaceparm skip</a></li>
|
||||
<li><a href="q3map-surface-parameter-directives.html#sky" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-surface-parameter-directives.html#sky">surfaceparm sky</a></li>
|
||||
<li><a href="q3map-surface-parameter-directives.html#slick" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-surface-parameter-directives.html#slick">surfaceparm slick</a></li>
|
||||
<li><a href="q3map-surface-parameter-directives.html#slime" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-surface-parameter-directives.html#slime">surfaceparm slime</a></li>
|
||||
<li><a href="q3map-surface-parameter-directives.html#structural" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-surface-parameter-directives.html#structural">surfaceparm structural</a></li>
|
||||
<li><a href="q3map-surface-parameter-directives.html#trans" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-surface-parameter-directives.html#trans">surfaceparm trans</a></li>
|
||||
<li><a href="q3map-surface-parameter-directives.html#water" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-surface-parameter-directives.html#water">surfaceparm water</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="quake-editor-radiant-directives.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/quake-editor-radiant-directives.html">Quake Editor Radiant Directives</a>
|
||||
<ul>
|
||||
<li><a href="quake-editor-radiant-directives.html#editorImage" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/quake-editor-radiant-directives.html#editorImage">qer_editorImage</a></li>
|
||||
<li><a href="quake-editor-radiant-directives.html#noCarve" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/quake-editor-radiant-directives.html#noCarve">qer_noCarve</a></li>
|
||||
<li><a href="quake-editor-radiant-directives.html#trans" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/quake-editor-radiant-directives.html#trans">qer_trans</a></li>
|
||||
<li><a href="quake-editor-radiant-directives.html#alphaFunc" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/quake-editor-radiant-directives.html#alphaFunc">qer_alphaFunc</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="stage-directives.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/stage-directives.html">Stage Directives</a>
|
||||
<ul>
|
||||
<li><a href="stage-directives.html#map" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/stage-directives.html#map">Texture Map Specification</a></li>
|
||||
<li><a href="stage-directives.html#blendFunc" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/stage-directives.html#blendFunc">blendFunc</a></li>
|
||||
<li><a href="stage-directives.html#rgbGen" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/stage-directives.html#rgbGen">rgbGen</a></li>
|
||||
<li><a href="stage-directives.html#alphaGen" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/stage-directives.html#alphaGen">alphaGen</a></li>
|
||||
<li><a href="stage-directives.html#tcGen" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/stage-directives.html#tcGen">tcGen</a></li>
|
||||
<li><a href="stage-directives.html#tcMod" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/stage-directives.html#tcMod">tcMod</a></li>
|
||||
<li><a href="stage-directives.html#depthFunc" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/stage-directives.html#depthFunc">depthFunc</a></li>
|
||||
<li><a href="stage-directives.html#depthWrite" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/stage-directives.html#depthWrite">depthWrite</a></li>
|
||||
<li><a href="stage-directives.html#detail" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/stage-directives.html#detail">detail</a></li>
|
||||
<li><a href="stage-directives.html#alphaFunc" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/stage-directives.html#alphaFunc">alphaFunc</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<!--
|
||||
<li>Platform Specific Directives
|
||||
<ul>
|
||||
<li></li>
|
||||
</ul>
|
||||
</li>
|
||||
-->
|
||||
</ul>
|
||||
</li><!-- end Directives -->
|
||||
<li><h3>Articles</h3>
|
||||
<ul>
|
||||
<li>Shader Basics
|
||||
<ul>
|
||||
<li><a href="texture-creation.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/texture-creation.html">Texture Creation</a></li>
|
||||
<li><a href="alpha-channels.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/alpha-channels.html">Alpha Channels</a></li>
|
||||
<li>Troubleshooting Tips</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Lighting Effects
|
||||
<ul>
|
||||
<li><a href="light-emitting-shaders.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/light-emitting-shaders.html">Light Emitting Shaders</a></li>
|
||||
<li>Normalmaps</li>
|
||||
<li><a href="lightstyles.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/lightstyles.html">Lightstyles</a></li>
|
||||
<li>Model Lighting</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Special Effects
|
||||
<ul>
|
||||
<li><a href="cel-shading.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/cel-shading.html">Cel Shading</a></li>
|
||||
<li><a href="decal-tricks.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/decal-tricks.html">Decal Tricks</a></li>
|
||||
<li><a href="foghull.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/foghull.html">Foghull</a></li>
|
||||
<li><a href="fur.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/fur.html">Fur</a></li>
|
||||
<li><a href="terrain-and-alphamod-blends.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/terrain-and-alphamod-blends.html">Terrain and alphaMod Blends</a></li>
|
||||
<li><a href="triggerable-shader-entities.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/triggerable-shader-entities.html">Triggerable Shader Entities</a></li>
|
||||
<!--
|
||||
Portal Skies
|
||||
-->
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li><!-- end Articles -->
|
||||
</ul>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
133
docs/shaderManual/decal-tricks.html
Normal file
|
|
@ -0,0 +1,133 @@
|
|||
<?xml version="1.1" encoding="iso-8859-1"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
|
||||
<head>
|
||||
<title>Q3Map2 Shader Manual</title>
|
||||
<meta name="keywords" content="id software, quake, radiant, qeradiant, gtkradiant, q3map, q3map2, shader, manual, ydnar, obsidian" />
|
||||
<meta name="description" content="Q3Map2 Shader Manual" />
|
||||
<meta name="copyright" content="Obsidian © 2010" />
|
||||
<link rel="stylesheet" href="default.css" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/_css/default.css" type="text/css" media="all" title="Default styles" />
|
||||
</head>
|
||||
<body id="articles">
|
||||
|
||||
<div id="nav">
|
||||
<div id="navbutton">
|
||||
<ul>
|
||||
<div id="navtop"></div>
|
||||
<li><a href="index.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/index.html">Q3Map2 Shader Manual</a></li>
|
||||
<li><a href="contents.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/contents.html">Full Contents</a></li>
|
||||
<li>Introduction
|
||||
<ul>
|
||||
<li><a href="preface.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/preface.html">Preface</a></li>
|
||||
<li><a href="shader-concepts.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/shader-concepts.html">Shader Concepts</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Directives
|
||||
<ul>
|
||||
<li><a href="general-directives.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/general-directives.html">General Directives</a></li>
|
||||
<li><a href="q3map-global-directives.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-global-directives.html">Q3Map Global Directives</a></li>
|
||||
<li><a href="q3map-surface-parameter-directives.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-surface-parameter-directives.html">Q3Map Surface Parameter Directives</a></li>
|
||||
<li><a href="quake-editor-radiant-directives.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/quake-editor-radiant-directives.html">Quake Editor Radiant Directives</a></li>
|
||||
<li><a href="stage-directives.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/stage-directives.html">Stage Directives</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Articles
|
||||
<ul>
|
||||
<li><a href="texture-creation.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/texture-creation.html">Texture Creation</a></li>
|
||||
<li><a href="alpha-channels.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/alpha-channels.html">Alpha Channels</a></li>
|
||||
<li><a href="light-emitting-shaders.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/light-emitting-shaders.html">Light Emitting Shaders</a></li>
|
||||
<li><a href="lightstyles.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/lightstyles.html">Lightstyles</a></li>
|
||||
<li><a href="cel-shading.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/cel-shading.html">Cel Shading</a></li>
|
||||
<li><a href="decal-tricks.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/decal-tricks.html">Decal Tricks</a></li>
|
||||
<li><a href="foghull.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/foghull.html">Foghull</a></li>
|
||||
<li><a href="fur.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/fur.html">Fur</a></li>
|
||||
<li><a href="terrain-and-alphamod-blends.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/terrain-and-alphamod-blends.html">Terrain and alphaMod Blends</a></li>
|
||||
<li><a href="triggerable-shader-entities.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/triggerable-shader-entities.html">Triggerable Shader Entities</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<div id="navlow"></div>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="header"><!-- START HEADER -->
|
||||
|
||||
<h1>Advanced Decal Tricks 101</h1>
|
||||
|
||||
</div><!-- END HEADER -->
|
||||
<div id=content><!-- START CONTENT-->
|
||||
|
||||
<h2>Multiplicative Decals</h2>
|
||||
|
||||
<p>Instead of doing blended or additive decals, sometimes the best effect is actually a multiply:</p>
|
||||
|
||||
<pre>
|
||||
blendFunc GL_DST_COLOR GL_ZERO
|
||||
</pre>
|
||||
|
||||
<p>The source texture is white with yellow/blue (or whatever) arrow on it. Combined with polygonOffset and perhaps a sort key, this can be a great way to get a decal effect that works okay with bullet marks and player shadows.</p>
|
||||
|
||||
<h2>Inverse Multiplicative Shadows</h2>
|
||||
|
||||
<p>While the above trick works well 95% of the time, sometimes you need to use fog. In order for a multiplicative decal to face out properly in fog, it has to be inverted, and using an inverse blendFunc:</p>
|
||||
|
||||
<pre>
|
||||
blendFunc GL_ZERO GL_ONE_MINUS_SRC_COLOR
|
||||
</pre>
|
||||
|
||||
<p>The source image will be negative of the above image, (white = black, blue = yellow, etc). This is the trick that the player shadow mark shader use.</p>
|
||||
|
||||
<img src="decal_geisha.jpg" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/_images/decal_geisha.jpg" alt="Original and inverted texture" class="center" />
|
||||
|
||||
<pre>
|
||||
textures/obsidian-blastburn_decals/p-geisha
|
||||
{
|
||||
noPicMip
|
||||
//draws polygons of this shader just above coplanar surface
|
||||
polygonOffset
|
||||
//prevents bounce from affecting this shader
|
||||
q3map_bounceScale 0
|
||||
surfaceparm detail
|
||||
surfaceparm nomarks
|
||||
surfaceparm nonsolid
|
||||
{
|
||||
map textures/obsidian-blastburn_decals/p-geisha.tga
|
||||
//inverse multiplicative blend (TGA channels inverted)
|
||||
blendFunc GL_ZERO GL_ONE_MINUS_SRC_COLOR
|
||||
}
|
||||
}
|
||||
</pre>
|
||||
|
||||
<h2>Using _decal Entities</h2>
|
||||
|
||||
<p>Sometimes laying out perfect patch meshes aligned with geometry is too much of a pain in the ass. Enter _decal entities. Add the following to your entities.def (Enemy Territory mappers should already have it):</p>
|
||||
|
||||
<pre>
|
||||
/*QUAKED _decal (0 1.0 0) ?
|
||||
-------- KEYS --------
|
||||
"target" : the name of the entity targetted at for projection
|
||||
-------- SPAWNFLAGS --------
|
||||
(none)
|
||||
-------- NOTES --------
|
||||
Compiler-only entity that specifies a decal to be projected. Should contain 1 or more patch meshes (curves) and target an info_null entity. The distance between the center of the _decal entity and the target is the axis and distance of projection.
|
||||
*/
|
||||
</pre>
|
||||
|
||||
<p>Make a simple patch mesh (it can be bent, but the quads in Radiant must be rectangular), select it and use the right-click context menu to turn it into a _decal entity. Target an info_null below the _decal entity and compile. Everything between the decal patch and the info_null will have a decal projected onto it.</p>
|
||||
|
||||
<img src="decal.jpg" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/_images/decal.jpg" alt="_decal Entity" class="center" />
|
||||
|
||||
<p>Make sure you compile with a recent (post-2.5) version of Q3Map2 with _decal support.</p>
|
||||
|
||||
<p>It will project onto terrain, brushes, models, patches, whatever. To suppress decals on particular shaders, use surfaceparm nomarks.</p>
|
||||
|
||||
<p>Happy decaling!</p>
|
||||
|
||||
<p>-ydnar</p>
|
||||
|
||||
</div><!-- END CONTENT-->
|
||||
|
||||
</body>
|
||||
</html>
|
||||
BIN
docs/shaderManual/decal.jpg
Normal file
|
After Width: | Height: | Size: 29 KiB |
BIN
docs/shaderManual/decal_geisha.jpg
Normal file
|
After Width: | Height: | Size: 23 KiB |
202
docs/shaderManual/default.css
Normal file
|
|
@ -0,0 +1,202 @@
|
|||
* { margin: 0; padding: 0; }
|
||||
|
||||
.hide { display: none; }
|
||||
.invisible { visibility: hidden; }
|
||||
|
||||
.center {
|
||||
display: block;
|
||||
clear: both;
|
||||
margin: 1em auto 1em auto;
|
||||
}
|
||||
|
||||
.right {
|
||||
float: right;
|
||||
padding-left: 32px;
|
||||
}
|
||||
|
||||
.left {
|
||||
float: left;
|
||||
padding-right: 32px;
|
||||
}
|
||||
|
||||
.clear {
|
||||
clear: both;
|
||||
}
|
||||
|
||||
html { background-color: #eee; }
|
||||
|
||||
body {
|
||||
font: 0.9em/1.5em Verdana, Lucida, Lucida Sans, Helvetica, Ariel, Sans-serif;
|
||||
background-color: white;
|
||||
width: 768px;
|
||||
margin: 0 auto 0 auto;
|
||||
padding: 1em 32px 4em 32px;
|
||||
}
|
||||
|
||||
h1, h2, h3, h4, h5, h6 {
|
||||
margin: 1em 0 1em 0;
|
||||
}
|
||||
|
||||
h2 {
|
||||
line-height: 32px;
|
||||
text-indent: 38px;
|
||||
background: transparent url("ql_32.png"/*tpa=http://robotrenegade.com/q3map2/docs/shader_manual/_images/ql_32.png*/) no-repeat;
|
||||
}
|
||||
|
||||
*+h2 {
|
||||
margin-top: 2em;
|
||||
}
|
||||
|
||||
p { margin-bottom: 1em; }
|
||||
|
||||
blockquote
|
||||
{
|
||||
margin: 1em 32px 1em 32px;
|
||||
padding: 0 1em 0 1em;
|
||||
font-size: 0.9em;
|
||||
line-height: normal;
|
||||
color: #444;
|
||||
background-color: #ffe;
|
||||
border: 1px #ccc solid;
|
||||
text-align: justify;
|
||||
}
|
||||
|
||||
blockquote h4 { margin-top: 0.5em; }
|
||||
|
||||
pre {
|
||||
margin: 1em 0 1em 0;
|
||||
padding: 0.5em 1em 0.5em 1em;
|
||||
max-height: 25.2em;
|
||||
overflow: auto;
|
||||
background-color: #eee;
|
||||
border: 1px solid #ccc;
|
||||
font-size: 0.9em;
|
||||
line-height: normal;
|
||||
}
|
||||
|
||||
a { text-decoration: none; color: #29387b; background-color: transparent; }
|
||||
a:hover { text-decoration: underline; color: #349; background-color: transparent; }
|
||||
a img { border: 0; }
|
||||
|
||||
ul+p { margin-top: 1em; }
|
||||
|
||||
li { margin-left: 2em; }
|
||||
|
||||
#contents li { list-style: none; }
|
||||
|
||||
dl {
|
||||
margin-bottom: 1em;
|
||||
line-height: normal;
|
||||
}
|
||||
|
||||
dt {
|
||||
font-weight: bold;
|
||||
margin-top: 0.5em;
|
||||
}
|
||||
|
||||
dd {
|
||||
border-left: 2px solid #000;
|
||||
margin: 0 0 0 4em;
|
||||
padding-left: 0.5em;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
#nav {
|
||||
z-index: 100;
|
||||
position: fixed;
|
||||
display: block;
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
top: 16px;
|
||||
right: 0;
|
||||
font-size: 8pt;
|
||||
}
|
||||
|
||||
#navtop {
|
||||
position: relative;
|
||||
height: 8px;
|
||||
width: 256px;
|
||||
background: url("navtop.png"/*tpa=http://robotrenegade.com/q3map2/docs/shader_manual/_images/navtop.png*/) no-repeat;
|
||||
}
|
||||
|
||||
#navlow {
|
||||
position: relative;
|
||||
top: 0;
|
||||
height: 8px;
|
||||
width: 256px;
|
||||
background: url("navlow.png"/*tpa=http://robotrenegade.com/q3map2/docs/shader_manual/_images/navlow.png*/) no-repeat;
|
||||
}
|
||||
|
||||
#navbutton {
|
||||
display: block;
|
||||
height: 32px;
|
||||
width: 32px;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
list-style: none;
|
||||
background: url("nav.png"/*tpa=http://robotrenegade.com/q3map2/docs/shader_manual/_images/nav.png*/) no-repeat;
|
||||
}
|
||||
|
||||
#navbutton ul {
|
||||
display: block;
|
||||
position: fixed;
|
||||
width: 256px;
|
||||
top: 16px;
|
||||
right: 0;
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* Major */
|
||||
#navbutton ul li {
|
||||
position: relative;
|
||||
margin: 0;
|
||||
padding: 0 0 1em 16px;
|
||||
list-style: none;
|
||||
line-height: 1.6em;
|
||||
font-weight: bold;
|
||||
border-left: 1px solid #ccc;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
/* Minor */
|
||||
#navbutton ul li ul {
|
||||
position: relative;
|
||||
top: 0;
|
||||
}
|
||||
|
||||
#navbutton ul li ul li {
|
||||
position: relative;
|
||||
padding: 0 0 0 2em;
|
||||
font-weight: normal;
|
||||
font-size: 7pt;
|
||||
border: none;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#navbutton:hover ul { display: block; }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* Index */
|
||||
#index { width: 600px; margin: 0 auto 0 auto; background-color: #eee; }
|
||||
|
||||
#v-space { width: 600px; position: absolute; top: 15%; }
|
||||
|
||||
#q3map2sm { height: 54px; border: 1px #ccc solid; background: white url("title.gif"/*tpa=http://robotrenegade.com/q3map2/docs/shader_manual/_images/title.gif*/) no-repeat 50%; }
|
||||
|
||||
#screenie { height: 255px; margin: 0; padding: 0; background: transparent url("titleImage.jpg"/*tpa=http://robotrenegade.com/q3map2/docs/shader_manual/_images/titleImage.jpg*/) no-repeat; }
|
||||
#screenie a { display: block; width: 600px; height: 255px; margin: 0; text-indent: -1000em; }
|
||||
|
||||
#footer { color: #999; clear: both; font: 8pt/1.5em verdana,arial,sans-serif; }
|
||||
#footer a, #footer a:link, #footer a:visited { color: #999; }
|
||||
#footer a:hover, #footer a:active { color: gray; }
|
||||
#footer #left { float: left; }
|
||||
#footer #right { float: right; }
|
||||
|
||||
#q3map2logo { position: absolute; right: 8px; bottom: 8px; }
|
||||
108
docs/shaderManual/foghull.html
Normal file
|
|
@ -0,0 +1,108 @@
|
|||
<?xml version="1.1" encoding="iso-8859-1"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
|
||||
<head>
|
||||
<title>Q3Map2 Shader Manual</title>
|
||||
<meta name="keywords" content="id software, quake, radiant, qeradiant, gtkradiant, q3map, q3map2, shader, manual, ydnar, obsidian" />
|
||||
<meta name="description" content="Q3Map2 Shader Manual" />
|
||||
<meta name="copyright" content="Obsidian © 2010" />
|
||||
<link rel="stylesheet" href="default.css" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/_css/default.css" type="text/css" media="all" title="Default styles" />
|
||||
</head>
|
||||
<body id="articles">
|
||||
|
||||
<div id="nav">
|
||||
<div id="navbutton">
|
||||
<ul>
|
||||
<div id="navtop"></div>
|
||||
<li><a href="index.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/index.html">Q3Map2 Shader Manual</a></li>
|
||||
<li><a href="contents.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/contents.html">Full Contents</a></li>
|
||||
<li>Introduction
|
||||
<ul>
|
||||
<li><a href="preface.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/preface.html">Preface</a></li>
|
||||
<li><a href="shader-concepts.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/shader-concepts.html">Shader Concepts</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Directives
|
||||
<ul>
|
||||
<li><a href="general-directives.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/general-directives.html">General Directives</a></li>
|
||||
<li><a href="q3map-global-directives.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-global-directives.html">Q3Map Global Directives</a></li>
|
||||
<li><a href="q3map-surface-parameter-directives.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-surface-parameter-directives.html">Q3Map Surface Parameter Directives</a></li>
|
||||
<li><a href="quake-editor-radiant-directives.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/quake-editor-radiant-directives.html">Quake Editor Radiant Directives</a></li>
|
||||
<li><a href="stage-directives.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/stage-directives.html">Stage Directives</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Articles
|
||||
<ul>
|
||||
<li><a href="texture-creation.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/texture-creation.html">Texture Creation</a></li>
|
||||
<li><a href="alpha-channels.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/alpha-channels.html">Alpha Channels</a></li>
|
||||
<li><a href="light-emitting-shaders.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/light-emitting-shaders.html">Light Emitting Shaders</a></li>
|
||||
<li><a href="lightstyles.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/lightstyles.html">Lightstyles</a></li>
|
||||
<li><a href="cel-shading.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/cel-shading.html">Cel Shading</a></li>
|
||||
<li><a href="decal-tricks.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/decal-tricks.html">Decal Tricks</a></li>
|
||||
<li><a href="foghull.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/foghull.html">Foghull</a></li>
|
||||
<li><a href="fur.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/fur.html">Fur</a></li>
|
||||
<li><a href="terrain-and-alphamod-blends.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/terrain-and-alphamod-blends.html">Terrain and alphaMod Blends</a></li>
|
||||
<li><a href="triggerable-shader-entities.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/triggerable-shader-entities.html">Triggerable Shader Entities</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<div id="navlow"></div>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h1>Foghull</h1>
|
||||
<p>Most recent Quake III engine games are programmed with a feature known as distance clipping used to clip (cull) map geometry beyond a user set distance. At the time of Quake III Arena's release, distance clipping was not an available feature. The Q3Map2 foghull feature was designed to simulate true distance clipping for Quake III Arena and Team Arena games.</p>
|
||||
|
||||
<h2>What is a Foghull?</h2>
|
||||
<p>Farplane distance clipping is a feature used to cull (remove) the drawing of polygons beyond a certain distance from the player in an attempt to improve performance. It is typically used on large, open terrain maps with little vis-blocking structures. Through the use of distance clipping a maximum vis distance is set, which provides the culling of rendered polygons. Fog is used to hide the effect of polygons appearing and disappearing by obscuring the maximum distance that the player can see.</p>
|
||||
|
||||
<p>Since distance clipping is not a feature natively built into Quake III Arena, using distance culling would result in a hall of mirrors (HOM) effect where the culled geometry begins, since nothing is being drawn in the frame buffer. To compensate for this, the foghull feature uses a series of six skybox images that are drawn in place of the absent culled geometry, thus preventing the HOM effect.</p>
|
||||
|
||||
<h2>Skybox Images</h2>
|
||||
<p>The skybox images used with the foghull feature should never be actually seen since the idea is to use the fog to obsure the maximum distance that the player can see. It only exists to prevent the HOM effect. To pull this off in a convincing manner, the skybox images should be six identical 8x8 pixel (to save on texture memory) textures each filled with a flat color matching the exact color of the fog. The six skybox images must be named in accordance to the skyParms farbox convention, using the _ft, _rt, _bk, _lf, _up, _dn suffixes.</p>
|
||||
|
||||
<h2>Foghull Shaders</h2>
|
||||
<p>Two shaders are required when using the foghull feature, a fog volume shader and a skybox shader, both of which are simple, standard shaders.</p>
|
||||
|
||||
<p>The color of the fog used must match the color used in the skybox images. Any decent image editing software will give you the three RGB color values of your skybox images, which must be normalized by dividing by 255. As with any other fog shader, the fogParms and surfaceparm fog keywords must be present.</p>
|
||||
|
||||
<pre>
|
||||
textures/env/fog1024
|
||||
{
|
||||
fogParms ( 0.8 0.8 0.8 ) 1024 //Normalized RGB, distance to opaque
|
||||
|
||||
surfaceparm fog //Must be used
|
||||
surfaceparm nolightmap
|
||||
surfaceparm nonsolid
|
||||
surfaceparm trans
|
||||
|
||||
qer_editorImage textures/sfx/fog_grey.tga
|
||||
qer_trans 0.4
|
||||
}
|
||||
</pre>
|
||||
|
||||
<p>The skyParms and surfaceparm sky keywords must be used to create the skybox "hull" of the map. The skyParms farbox value must point to the base name of the skybox images (sans suffix). Optional surface emitted sun lighting can be added using q3map_skylight with q3map_sun or q3map_sunExt (see Appendix I: Light Emitting Shaders).</p>
|
||||
|
||||
<pre>
|
||||
textures/skies/foghullsky
|
||||
{
|
||||
skyParms textures/skies/foghullsky 0 - //farbox cloudheight nearbox
|
||||
|
||||
surfaceparm nolightmap
|
||||
surfaceparm nonsolid
|
||||
surfaceparm sky //Must be used
|
||||
surfaceparm trans
|
||||
}
|
||||
</pre>
|
||||
|
||||
<h2>Entity Key Value Pairs</h2>
|
||||
<p>To activate the foghull feature, the _foghull and _farplanedist worldspawn entity key/value pairs must be set in the Entity Inspector (in Radiant, select any non-entity brush and press "N").</p>
|
||||
|
||||
<p>The _foghull key's value works similar to that of terrain entities. It must point to the name of the skybox shader, minus the standard "textures/" prefix. For the skybox shader example above with the shader name "textures/skies/foghullsky", you would use a _foghull value of "skies/foghullsky".</p>
|
||||
|
||||
<p>The _farplanedist value is simply the distance at which polygons will begin to get culled. One important note is that the _farplanedist value must be greater than the distance to opaque value set in the fog shader. In the above fog shader, the distance to opaque value was set to 1024 game units. The _farplanedist value must therefore be greater than 1024, otherwise the HOM effect will appear.</p>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
110
docs/shaderManual/fur.html
Normal file
|
|
@ -0,0 +1,110 @@
|
|||
<?xml version="1.1" encoding="iso-8859-1"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
|
||||
<head>
|
||||
<title>Q3Map2 Shader Manual</title>
|
||||
<meta name="keywords" content="id software, quake, radiant, qeradiant, gtkradiant, q3map, q3map2, shader, manual, ydnar, obsidian" />
|
||||
<meta name="description" content="Q3Map2 Shader Manual" />
|
||||
<meta name="copyright" content="Obsidian © 2010" />
|
||||
<link rel="stylesheet" href="default.css" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/_css/default.css" type="text/css" media="all" title="Default styles" />
|
||||
</head>
|
||||
<body id="articles">
|
||||
|
||||
<div id="nav">
|
||||
<div id="navbutton">
|
||||
<ul>
|
||||
<div id="navtop"></div>
|
||||
<li><a href="index.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/index.html">Q3Map2 Shader Manual</a></li>
|
||||
<li><a href="contents.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/contents.html">Full Contents</a></li>
|
||||
<li>Introduction
|
||||
<ul>
|
||||
<li><a href="preface.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/preface.html">Preface</a></li>
|
||||
<li><a href="shader-concepts.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/shader-concepts.html">Shader Concepts</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Directives
|
||||
<ul>
|
||||
<li><a href="general-directives.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/general-directives.html">General Directives</a></li>
|
||||
<li><a href="q3map-global-directives.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-global-directives.html">Q3Map Global Directives</a></li>
|
||||
<li><a href="q3map-surface-parameter-directives.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-surface-parameter-directives.html">Q3Map Surface Parameter Directives</a></li>
|
||||
<li><a href="quake-editor-radiant-directives.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/quake-editor-radiant-directives.html">Quake Editor Radiant Directives</a></li>
|
||||
<li><a href="stage-directives.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/stage-directives.html">Stage Directives</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Articles
|
||||
<ul>
|
||||
<li><a href="texture-creation.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/texture-creation.html">Texture Creation</a></li>
|
||||
<li><a href="alpha-channels.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/alpha-channels.html">Alpha Channels</a></li>
|
||||
<li><a href="light-emitting-shaders.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/light-emitting-shaders.html">Light Emitting Shaders</a></li>
|
||||
<li><a href="lightstyles.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/lightstyles.html">Lightstyles</a></li>
|
||||
<li><a href="cel-shading.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/cel-shading.html">Cel Shading</a></li>
|
||||
<li><a href="decal-tricks.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/decal-tricks.html">Decal Tricks</a></li>
|
||||
<li><a href="foghull.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/foghull.html">Foghull</a></li>
|
||||
<li><a href="fur.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/fur.html">Fur</a></li>
|
||||
<li><a href="terrain-and-alphamod-blends.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/terrain-and-alphamod-blends.html">Terrain and alphaMod Blends</a></li>
|
||||
<li><a href="triggerable-shader-entities.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/triggerable-shader-entities.html">Triggerable Shader Entities</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<div id="navlow"></div>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h1>Fur</h1>
|
||||
<p>"Fur" shaders allow a surface to replicate itself or another shader above its surface in multiple layers. Care should be taken when using fur shaders, they can quickly cause drops in performance.</p>
|
||||
|
||||
<img src="fur.jpg" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/_images/fur.jpg" width="400" height="300" alt="Tribble" class="center" />
|
||||
|
||||
<h2>q3map_cloneShader</h2>
|
||||
<p><a href="file:///C:/Users/Emile/Desktop/Web%20Projects/docs/shader_manual_2.4_2010-04/q3map-global-directives.html#q3map_cloneShader">q3map_cloneShader</a> allows the base shader to inherit the target shader's properties and appearance. Beware not to reference another cloning shader or itself as this can lead to an infinite loop. For fur, the base shader is the texture applied to the polygon surface.</p>
|
||||
|
||||
<pre>
|
||||
// base texture
|
||||
textures/fur/pink_base
|
||||
{
|
||||
// points to the fur shader (see below)
|
||||
q3map_cloneshader textures/fur/pink_fur
|
||||
{
|
||||
map $lightmap
|
||||
}
|
||||
{
|
||||
map textures/fur/pink_base.tga
|
||||
blendFunc GL_DST_COLOR GL_ZERO
|
||||
}
|
||||
}
|
||||
</pre>
|
||||
|
||||
<h2>q3map_fur</h2>
|
||||
<p><a href="file:///C:/Users/Emile/Desktop/Web%20Projects/docs/shader_manual_2.4_2010-04/q3map-global-directives.html#q3map_fur">q3map_fur</a> generates additional surfaces above the base shader. The q3map_fur directive takes a few values: layers, offset and fade. Layers controls the number of surfaces generated (start with low values, high values will very quickly cause a reduction in performance). Offset controls the distance between layers. Fade controls how much each additional layer fades in addition to its previous layer. The fur shader shouldn't be applied to surface geometry as it is implicitly generated above the base shader.</p>
|
||||
|
||||
<pre>
|
||||
// fur texture
|
||||
textures/fur/pink_fur
|
||||
{
|
||||
q3map_lightimage textures/fur/pink_fur.q3map.tga
|
||||
|
||||
q3map_notjunc
|
||||
q3map_nonplanar
|
||||
q3map_bounce 0.0
|
||||
q3map_shadeangle 120
|
||||
|
||||
// format: q3map_fur <layers> <offset> <fade>
|
||||
q3map_fur 8 1.25 0.1
|
||||
|
||||
surfaceparm trans
|
||||
surfaceparm pointlight
|
||||
surfaceparm alphashadow
|
||||
surfaceparm nonsolid
|
||||
surfaceparm noimpact
|
||||
|
||||
nomipmaps
|
||||
{
|
||||
map textures/fur/pink_fur.tga
|
||||
//alphaFunc GE128
|
||||
blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
|
||||
rgbGen vertex
|
||||
}
|
||||
}
|
||||
</pre>
|
||||
BIN
docs/shaderManual/fur.jpg
Normal file
|
After Width: | Height: | Size: 16 KiB |
199
docs/shaderManual/general-directives.html
Normal file
|
|
@ -0,0 +1,199 @@
|
|||
<?xml version="1.1" encoding="iso-8859-1"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
|
||||
<head>
|
||||
<title>Q3Map2 Shader Manual</title>
|
||||
<meta name="keywords" content="id software, quake, radiant, qeradiant, gtkradiant, q3map, q3map2, shader, manual, ydnar, obsidian" />
|
||||
<meta name="description" content="Q3Map2 Shader Manual" />
|
||||
<meta name="copyright" content="Obsidian © 2010" />
|
||||
<link rel="stylesheet" href="default.css" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/_css/default.css" type="text/css" media="all" title="Default styles" />
|
||||
</head>
|
||||
<body id="dir_general">
|
||||
|
||||
<div id="nav">
|
||||
<div id="navbutton">
|
||||
<ul>
|
||||
<div id="navtop"></div>
|
||||
<li><a href="index.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/index.html">Q3Map2 Shader Manual</a></li>
|
||||
<li><a href="contents.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/contents.html">Full Contents</a></li>
|
||||
<li>Introduction
|
||||
<ul>
|
||||
<li><a href="preface.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/preface.html">Preface</a></li>
|
||||
<li><a href="shader-concepts.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/shader-concepts.html">Shader Concepts</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Directives
|
||||
<ul>
|
||||
<li><a href="general-directives.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/general-directives.html">General Directives</a></li>
|
||||
<li><a href="q3map-global-directives.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-global-directives.html">Q3Map Global Directives</a></li>
|
||||
<li><a href="q3map-surface-parameter-directives.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-surface-parameter-directives.html">Q3Map Surface Parameter Directives</a></li>
|
||||
<li><a href="quake-editor-radiant-directives.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/quake-editor-radiant-directives.html">Quake Editor Radiant Directives</a></li>
|
||||
<li><a href="stage-directives.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/stage-directives.html">Stage Directives</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Articles
|
||||
<ul>
|
||||
<li><a href="texture-creation.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/texture-creation.html">Texture Creation</a></li>
|
||||
<li><a href="alpha-channels.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/alpha-channels.html">Alpha Channels</a></li>
|
||||
<li><a href="light-emitting-shaders.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/light-emitting-shaders.html">Light Emitting Shaders</a></li>
|
||||
<li><a href="lightstyles.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/lightstyles.html">Lightstyles</a></li>
|
||||
<li><a href="cel-shading.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/cel-shading.html">Cel Shading</a></li>
|
||||
<li><a href="decal-tricks.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/decal-tricks.html">Decal Tricks</a></li>
|
||||
<li><a href="foghull.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/foghull.html">Foghull</a></li>
|
||||
<li><a href="fur.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/fur.html">Fur</a></li>
|
||||
<li><a href="terrain-and-alphamod-blends.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/terrain-and-alphamod-blends.html">Terrain and alphaMod Blends</a></li>
|
||||
<li><a href="triggerable-shader-entities.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/triggerable-shader-entities.html">Triggerable Shader Entities</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<div id="navlow"></div>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h1>General Directives</h1>
|
||||
<p>General shader directives are global and affect all stages. They are read by the game engine only and are ignored by Q3Map2.</p>
|
||||
|
||||
<h2 id="skyParms">skyParms farbox cloudheight nearbox</h2>
|
||||
<p>Specifies how to use the surface as a sky, including an optional far box (stars, moon, etc), optional cloud layers with any shader attributes, and an optional near box (mountains in front of the clouds, etc).</p>
|
||||
<dl>
|
||||
<dt>farbox</dt><dd>Specifies a set of files to use as an environment box behind all cloudlayers. Specify "-" for no farbox, or a file base name. A base name of "env/test" would look for files "env/test_rt.tga", "env/test_lf.tga", "env/test_ft.tga", "env/test_bk.tga", "env/test_up.tga", "env/test_dn.tga" to use as the right, left, front, back, up, and down sides.</dd>
|
||||
<dt>cloudheight</dt><dd>Controls apparent curvature of the cloud layers - lower numbers mean more curvature (and thus more distortion at the horizons). Higher height values create "flatter" skies with less horizon distortion. Think of height as the radius of a sphere on which the clouds are mapped. Good ranges are 64 to 256. The default value is 128.</dd>
|
||||
<dt>nearbox</dt><dd>Specified as farbox, to be alpha blended ontop of the clouds. This has not be tested in a long time, so it probably doesn't actually work. Set to "-" to ignore.</dd>
|
||||
</dl>
|
||||
<blockquote>
|
||||
<h4>Design Notes:</h4>
|
||||
<p>If you are making a map where the sky is seen by looking up most of the time, use a lower cloudheight value. Under those circumstances the tighter curve looks more dynamic. If you are making a map where the sky is seen by looking out windows most of the time or has a map area that is open to the sky on one or more sides, use a higher height to make the clouds seem more natural.</p>
|
||||
<p>It is possible to create a sky with up to 8 cloudlayers (I don't think this is a physical limit, more of a practical one - see below), but that also means 8 processing passes and a potentially large processing hit.</p>
|
||||
<p>Be aware that the skybox does not wrap around the entire world. The "floor" or bottom face of the skybox is not drawn by the game. If a player in the game can see that face, they will see the "hall of mirrors" effect.</p>
|
||||
<p>There's a bug in Quake 3 (but fixed in Enemy Territory) that causes a shader vertex overflow (SHADER_MAX_VERTEXES HIT IN FILLCLOUD SKY SIDE) if too many cloud layers are used in maps with a lot of visible sky. To compensate, either reduce the amount of visible sky or limit the shader to two cloud layers. Q3Map2 sky portals may be a good alternative if you feel a standard sky isn't interesting enough.</p>
|
||||
</blockquote>
|
||||
<p>Q3Map2 sky shaders work differently from the original and contain a number of improvements in terms of efficiency and visually. The example given below is an original Quake III Arena sky shader. While it is still operational, it is a little outdated and is being kept here for legacy purposes only. It is recommended that you take advantage of the new features of Q3Map2 skies by consulting Appendix: Light Emitting Shaders. Below is an example of a default (pre-Q3Map2) Quake 3 sky shader.</p>
|
||||
<pre>
|
||||
textures/skies/xtoxicsky_dm9
|
||||
{
|
||||
qer_editorimage textures/skies/toxicsky.tga
|
||||
surfaceparm noimpact
|
||||
surfaceparm nolightmap
|
||||
q3map_globaltexture
|
||||
q3map_lightsubdivide 256
|
||||
q3map_surfacelight 400
|
||||
surfaceparm sky
|
||||
q3map_sun 1 1 0.5 150 30 60
|
||||
skyparms full 512 -
|
||||
{
|
||||
map textures/skies/inteldimclouds.tga
|
||||
tcMod scale 3 2
|
||||
tcMod scroll 0.1 0.1
|
||||
}
|
||||
{
|
||||
map textures/skies/intelredclouds.tga
|
||||
blendFunc add
|
||||
tcMod scale 3 3
|
||||
tcMod scroll 0.05 0.05
|
||||
}
|
||||
}
|
||||
</pre>
|
||||
|
||||
<h2 id="cull">cull side</h2>
|
||||
<p>Every surface of a polygon has two sides, a front and a back. Typically, we only see the front or "out" side. For example, a solid block you only show the front side. In many applications we see both. For example, in water, you can see both front and a back. The same is true for things like grates and screens.</p>
|
||||
<p>To "cull" means to remove. The value parameter determines the type of face culling to apply. The default value is cull back if this keyword is not specified. However for items that should be inverted then the value front should be used. To disable culling, the value disable or none should be used. Only one cull instruction can be set for the shader.</p>
|
||||
<dl>
|
||||
<dt>front</dt><dd>The front or "outside" of the polygon is not drawn in the world. It is used if the keyword "cull" appears in the content instructions without a side value.</dd>
|
||||
<dt>back</dt><dd>Cull back removes the back or "inside" of a polygon from being drawn in the world.</dd>
|
||||
<dt>disable or none</dt><dd>Neither side of the polygon is removed. Both sides are drawn in the game. Very useful for making panels or barriers that have no depth, such as grates, screens, metal wire fences and so on and for liquid volumes that the player can see from within. Also used for energy fields, sprites, and weapon effects (e.g. plasma).</dd>
|
||||
</dl>
|
||||
<blockquote>
|
||||
<h4>Design Notes:</h4>
|
||||
<p>For things like grates and screens, put the texture with the cull none property on one face only. On the other faces, use a non-drawing texture.</p>
|
||||
</blockquote>
|
||||
|
||||
<h2 id="deformVertexes">deformVertexes type</h2>
|
||||
<p>This function performs a general deformation on the surface's vertexes, changing the actual shape of the surface before drawing the shader passes. You can stack multiple deformVertexes commands to modify positions in more complex ways, making an object move in two dimensions, for instance. There are 6 possible values for the type parameter, each of which will be described in more detail: wave, normal, bulge, move, autosprite, autosprite2. Depending on which of the 6 type parameters are used, different additional parameters will need to be used, including the generalized waveform functions (see Introduction: Key Concepts).</p>
|
||||
<blockquote>
|
||||
<h4>Design Notes:</h4>
|
||||
<p>The div and amplitude parameters, when used in conjunction with liquid volumes like water should take into consideration how much the water will be moving. A large ocean area would have have massive swells (big div values) that rose and fell dramatically (big amplitude values). While a small, quiet pool may move very little.</p>
|
||||
</blockquote>
|
||||
|
||||
<h3>deformVertexes wave div func base amplitude phase freq</h3>
|
||||
<p>Designed for water surfaces, modifying the values differently at each point. The div parameter is used to control the wave "spread" - a value equal to the q3map_tessSize of the surface is a good default value. It accepts the standard wave functions sin, triangle, square, sawtooth or inversesawtooth.</p>
|
||||
|
||||
<h3>deformVertexes normal amplitude freq</h3>
|
||||
<p>This deformation affects the normals of a vertex without actually moving it, which will effect later shader options like lighting and especially environment mapping. If the shader stages don't use normals in any of their calculations, there will be no visible effect. Good values for amplitude ranges from 0.1 to 0.5 while values of 1.0 to 4.0 are good for frequency.</p>
|
||||
<blockquote>
|
||||
<h4>Design Notes:</h4>
|
||||
<p>Putting values of 0.1 to 0.5 in Amplitude and 1.0 to 4.0 in the Frequency can produce some satisfying results. Some things that have been done with it: A small fluttering bat, falling leaves, rain, flags.</p>
|
||||
</blockquote>
|
||||
|
||||
<h3>deformVertexes bulge div ampl freq</h3>
|
||||
<p>This forces a bulge to move along S texture direction. Designed for use on curved pipes. Div sets how frequently bulges are placed, the bigger value means more bulges. Amplitude parameter is the amount of bulge displacement measured in game units.</p>
|
||||
|
||||
<h3>deformVertexes move x y z func base amplitude phase freq</h3>
|
||||
<p>The move parameter is used to make a brush, curve patch or model appear to move together as a unit. The x y z values are the distance and direction in game units the object appears to move relative to it's point of origin in the map. The func base amplitude phase freq values are the same as found in other waveform manipulations.</p>
|
||||
<p>The product of the function modifies the values x, y, and z. Therefore, if you have an amplitude of 5 and an x value of 2, the object will travel 10 units from its point of origin along the x axis. This results in a total of 20 units of motion along the x axis, since the amplitude is the variation both above and below the base.</p>
|
||||
<p>It must be noted that an object made with this shader does not actually change position, it only appears to.</p>
|
||||
<blockquote>
|
||||
<h4>Design Notes:</h4>
|
||||
<p>If an object is made up of surfaces with different shaders, all must have matching deformVertexes move values or the object will appear to tear itself apart.</p>
|
||||
</blockquote>
|
||||
|
||||
<h3>deformVertexes autosprite</h3>
|
||||
<p>This function can be used to make any given triangle quad (pair of triangles that form a square rectangle) automatically behave like a sprite without having to make it a separate entity. This means that the "sprite" on which the texture is placed will rotate to always appear at right angles to the player's view as a sprite would. Any four-sided brush side, flat patch, or pair of triangles in a model can have the autosprite effect on it. The brush face containing a texture with this shader keyword must be square.</p>
|
||||
|
||||
<h3>deformVertexes autosprite2</h3>
|
||||
<p>Is a slightly modified "sprite" that only rotates around the middle of its longest axis. This allows you to make a pillar of fire that you can walk around, or an energy beam stretched across the room.</p>
|
||||
|
||||
<h2 id="fogParms">fogParms ( r g b ) opacity</h2>
|
||||
<p>Fogparms describes how to render the fog on the surfaces. You must also specify "surfaceparm fog" to cause Q3Map2 to identify the surfaces inside the volume.</p>
|
||||
<dl>
|
||||
<dt>r g b</dt><dd>These are normalized values. A good computer art program should give you the RGB values for a color. To obtain the values that define fog color for Quake III Arena, divide the desired color's red, green and blue values by 255 to obtain three normalized numbers within the 0.0 to 1.0 range.</dd>
|
||||
<dt>opacity</dt><dd>This is the distance, in game units, until the fog becomes totally opaque, as measured from the point of view of the observer. By making the height of the fog brush shorter than the distance to opaque, the apparent density of the fog can be reduced (because it never reaches the depth at which full opacity occurs).</dd>
|
||||
</dl>
|
||||
<p>Fog volume brushes must obey the following rules:</p>
|
||||
<ul>
|
||||
<li>The fog volume can only have one surface visible (from outside the fog).</li>
|
||||
<li>Fog must be made of one brush. It cannot be made of adjacent brushes.</li>
|
||||
<li>Fog brushes must be axial. This means that only square or rectangular brushes may contain fog, and those must have their edges drawn along the axes of the map grid (all 90 degree angles).</li>
|
||||
</ul>
|
||||
<blockquote>
|
||||
<h4>Design Notes:</h4>
|
||||
<p>If a water texture contains a fog parameter, it must be treated as if it were a fog texture when in use.</p>
|
||||
<p>If a room is to be filled completely with a fog volume,it can only be entered through one surface (and still have the fog function correctly).</p>
|
||||
<p>Additional shader passes may be placed on a fog brush, as with other brushes.</p>
|
||||
</blockquote>
|
||||
|
||||
<h2 id="noPicMip">noPicMip</h2>
|
||||
<p>This causes the texture to ignore user-set values for the r_picmip cvar command. The image will always be high resolution. Example: Used to keep images and text in the heads up display from blurring when user optimizes the game graphics.</p>
|
||||
|
||||
<h2 id="noMipMaps">noMipMaps</h2>
|
||||
<p>This implies noPicMip, but also prevents the generation of any lower resolution mipmaps for use by the 3D card. This will cause the texture to alias when it gets smaller, but there are some cases where you would rather have this than a blurry image. Sometimes thin slivers of triangles force things to very low mipmap levels, which leave a few constant pixels on otherwise scrolling special effects.</p>
|
||||
|
||||
<h2 id="polygonOffset">polygonOffset</h2>
|
||||
<p>Surfaces rendered with the polygonOffset keyword are rendered slightly off the polygon's surface. This is typically used for wall markings and "decals." The distance between the offset and the polygon is fixed. It is not a variable in Quake III Arena.</p>
|
||||
<blockquote>
|
||||
<h4>Design Notes:</h4>
|
||||
<p>Use this for wall or floor markings, particularily for direction arrows for team games. Texture the brush with the decal shader on one face and the other faces with a nodraw shader. Then place the brush flush with the surface of the wall or floor.</p>
|
||||
<p>When using a _decal entity for texture projection, polygonOffset must be used to prevent Z-fighting. If you experience problems with depth sorting, try using sort 6.</p>
|
||||
</blockquote>
|
||||
|
||||
<h2 id="portal">portal</h2>
|
||||
<p>Specifies that this texture is the surface for a portal or mirror. In the game map, a portal entity must be placed directly in front of the texture (within 64 game units). All this does is set "sort portal", so it isn't needed if you specify that explicitly.</p>
|
||||
|
||||
<h2 id="sort">sort value</h2>
|
||||
<p>Use this keyword to fine-tune the depth sorting of shaders as they are compared against other shaders in the game world. The basic concept is that if there is a question or a problem with shaders drawing in the wrong order against each other, this allows the designer to create a hierarchy of which shader draws in what order.</p>
|
||||
<p>The default behavior is to put all blended shaders in sort "additive" and all other shaders in sort "opaque", so you only need to specify this when you are trying to work around a sorting problem with multiple transparent surfaces in a scene.</p>
|
||||
<p>The value here can be either a numerical value or one of the keywords in the following list (listed in order of ascending priority):</p>
|
||||
<dl>
|
||||
<dt>portal (1)</dt><dd>This surface is a portal, it draws over every other shader seen inside the portal, but before anything in the main view.</dd>
|
||||
<dt>Sky (2)</dt><dd>Typically, the sky is the farthest surface in the game world. Drawing this after other opaque surfaces can be an optimization on some cards. This currently has the wrong value for this purpose, so it doesn't do much of anything.</dd>
|
||||
<dt>Opaque (3)</dt><dd>This surface is opaque (rarely needed since this is the default with no blendfunc)</dd>
|
||||
<dt>Banner (6)</dt><dd>Transparent, but very close to walls.</dd>
|
||||
<dt>Underwater (8)</dt><dd>Draw behind normal transparent surfaces.</dd>
|
||||
<dt>Additive (9)</dt><dd>Normal transparent surface (default for shaders with blendfunc's)</dd>
|
||||
<dt>Nearest (16)</dt><dd>This shader should always sort closest to the viewer, e.g. muzzle flashes and blend blobs.</dd>
|
||||
</dl>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
98
docs/shaderManual/index.html
Normal file
|
|
@ -0,0 +1,98 @@
|
|||
<?xml version="1.1" encoding="iso-8859-1"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
|
||||
<head>
|
||||
<title>Q3Map2 Shader Manual</title>
|
||||
<meta name="keywords" content="id software, quake, radiant, qeradiant, gtkradiant, q3map, q3map2, shader, manual, ydnar, obsidian" />
|
||||
<meta name="description" content="Q3Map2 Shader Manual" />
|
||||
<meta name="copyright" content="Obsidian © 2010" />
|
||||
<link rel="stylesheet" href="default.css" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/_css/default.css" type="text/css" media="all" title="Default styles" />
|
||||
</head>
|
||||
<body id="index">
|
||||
|
||||
<div id="v-space">
|
||||
<div id="splash">
|
||||
<div id="q3map2sm">
|
||||
|
||||
</div>
|
||||
<h1 id="screenie"><a href="contents.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/contents.html" title="Enter">Q3Map2 Shader Manual</a></h1>
|
||||
</div>
|
||||
<div id="footer">
|
||||
<p class="left">Q3Map2 2.5.16</p>
|
||||
<p class="right">SM v2.4b1 (2010-11-01)</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="nav">
|
||||
<div id="navbutton">
|
||||
<ul>
|
||||
<div id="navtop"></div>
|
||||
<li><a href="index.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/index.html">Q3Map2 Shader Manual</a></li>
|
||||
<li><a href="contents.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/contents.html">Full Contents</a></li>
|
||||
<li>Introduction
|
||||
<ul>
|
||||
<li><a href="preface.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/preface.html">Preface</a></li>
|
||||
<li><a href="shader-concepts.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/shader-concepts.html">Shader Concepts</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Directives
|
||||
<ul>
|
||||
<li><a href="general-directives.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/general-directives.html">General Directives</a></li>
|
||||
<li><a href="q3map-global-directives.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-global-directives.html">Q3Map Global Directives</a></li>
|
||||
<li><a href="q3map-surface-parameter-directives.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-surface-parameter-directives.html">Q3Map Surface Parameter Directives</a></li>
|
||||
<li><a href="quake-editor-radiant-directives.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/quake-editor-radiant-directives.html">Quake Editor Radiant Directives</a></li>
|
||||
<li><a href="stage-directives.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/stage-directives.html">Stage Directives</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Articles
|
||||
<ul>
|
||||
<li><a href="texture-creation.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/texture-creation.html">Texture Creation</a></li>
|
||||
<li><a href="alpha-channels.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/alpha-channels.html">Alpha Channels</a></li>
|
||||
<li><a href="light-emitting-shaders.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/light-emitting-shaders.html">Light Emitting Shaders</a></li>
|
||||
<li><a href="lightstyles.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/lightstyles.html">Lightstyles</a></li>
|
||||
<li><a href="cel-shading.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/cel-shading.html">Cel Shading</a></li>
|
||||
<li><a href="decal-tricks.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/decal-tricks.html">Decal Tricks</a></li>
|
||||
<li><a href="foghull.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/foghull.html">Foghull</a></li>
|
||||
<li><a href="fur.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/fur.html">Fur</a></li>
|
||||
<li><a href="terrain-and-alphamod-blends.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/terrain-and-alphamod-blends.html">Terrain and alphaMod Blends</a></li>
|
||||
<li><a href="triggerable-shader-entities.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/triggerable-shader-entities.html">Triggerable Shader Entities</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<div id="navlow"></div>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<img src="q3map2.gif" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/_images/q3map2.gif" width="88px" height="32px" alt="I <3 My Q3Map2" id="q3map2logo" />
|
||||
|
||||
<!--
|
||||
Radiant
|
||||
Q3Map2
|
||||
|
||||
<ul>
|
||||
<li>Full Contents</li>
|
||||
<li>Introduction
|
||||
<ul>
|
||||
<li>Preface</li>
|
||||
<li>Shader Concepts</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Directives
|
||||
<ul>
|
||||
<li>General Directives</li>
|
||||
<li>Q3Map Global Directives</li>
|
||||
<li>Q3Map Surface Parameter Directives</li>
|
||||
<li>Radiant Editor Directives</li>
|
||||
<li>Stage Directives</li>
|
||||
<li>Platform Specific Directives</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Articles</li>
|
||||
</ul>
|
||||
-->
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
254
docs/shaderManual/light-emitting-shaders.html
Normal file
|
|
@ -0,0 +1,254 @@
|
|||
<?xml version="1.1" encoding="iso-8859-1"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
|
||||
<head>
|
||||
<title>Q3Map2 Shader Manual</title>
|
||||
<meta name="keywords" content="id software, quake, radiant, qeradiant, gtkradiant, q3map, q3map2, shader, manual, ydnar, obsidian" />
|
||||
<meta name="description" content="Q3Map2 Shader Manual" />
|
||||
<meta name="copyright" content="Obsidian © 2010" />
|
||||
<link rel="stylesheet" href="default.css" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/_css/default.css" type="text/css" media="all" title="Default styles" />
|
||||
</head>
|
||||
<body id="articles">
|
||||
|
||||
<div id="nav">
|
||||
<div id="navbutton">
|
||||
<ul>
|
||||
<div id="navtop"></div>
|
||||
<li><a href="index.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/index.html">Q3Map2 Shader Manual</a></li>
|
||||
<li><a href="contents.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/contents.html">Full Contents</a></li>
|
||||
<li>Introduction
|
||||
<ul>
|
||||
<li><a href="preface.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/preface.html">Preface</a></li>
|
||||
<li><a href="shader-concepts.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/shader-concepts.html">Shader Concepts</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Directives
|
||||
<ul>
|
||||
<li><a href="general-directives.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/general-directives.html">General Directives</a></li>
|
||||
<li><a href="q3map-global-directives.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-global-directives.html">Q3Map Global Directives</a></li>
|
||||
<li><a href="q3map-surface-parameter-directives.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-surface-parameter-directives.html">Q3Map Surface Parameter Directives</a></li>
|
||||
<li><a href="quake-editor-radiant-directives.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/quake-editor-radiant-directives.html">Quake Editor Radiant Directives</a></li>
|
||||
<li><a href="stage-directives.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/stage-directives.html">Stage Directives</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Articles
|
||||
<ul>
|
||||
<li><a href="texture-creation.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/texture-creation.html">Texture Creation</a></li>
|
||||
<li><a href="alpha-channels.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/alpha-channels.html">Alpha Channels</a></li>
|
||||
<li><a href="light-emitting-shaders.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/light-emitting-shaders.html">Light Emitting Shaders</a></li>
|
||||
<li><a href="lightstyles.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/lightstyles.html">Lightstyles</a></li>
|
||||
<li><a href="cel-shading.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/cel-shading.html">Cel Shading</a></li>
|
||||
<li><a href="decal-tricks.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/decal-tricks.html">Decal Tricks</a></li>
|
||||
<li><a href="foghull.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/foghull.html">Foghull</a></li>
|
||||
<li><a href="fur.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/fur.html">Fur</a></li>
|
||||
<li><a href="terrain-and-alphamod-blends.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/terrain-and-alphamod-blends.html">Terrain and alphaMod Blends</a></li>
|
||||
<li><a href="triggerable-shader-entities.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/triggerable-shader-entities.html">Triggerable Shader Entities</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<div id="navlow"></div>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h1>Light Emitting Shaders</h1>
|
||||
<p>Q3Map2 surface light and sky shaders are quite different than the original Quake III shaders. As new lighting algorithms were introduced, new shader keywords were created to accompany or replace the original keywords. This section will illustrate the differences between these shaders.</p>
|
||||
|
||||
<h2>Surface Lights</h2>
|
||||
<p>(Pending)</p>
|
||||
<!-- add stuff about q3map_lightRGB red green blue -->
|
||||
|
||||
<h2>Skies</h2>
|
||||
<p>Originally, sky shaders were just very large surface lights that casted parallel directional lighting. With Q3Map2, there are a few differences that sets sky shaders apart from surface lights. First of all, we'll take a look at how the pre-Q3Map2 shaders were set up:</p>
|
||||
|
||||
<pre>
|
||||
textures/shadermanual/sky
|
||||
{
|
||||
skyparms textures/shaderlab_terrain/env/sky 1024 - //farbox cloudheight nearbox
|
||||
|
||||
q3map_lightImage textures/shaderlab_terrain/sky_clouds.tga
|
||||
|
||||
q3map_sun 1 1 1 140 -35 25 //red green blue intensity degrees elevation
|
||||
q3map_lightSubdivide 256 //sets a pointlight every 256 game units
|
||||
q3map_surfaceLight 200 //emits 200 units of light
|
||||
|
||||
surfaceparm sky //flags compiler that this is sky
|
||||
surfaceparm noimpact
|
||||
surfaceparm nolightmap
|
||||
surfaceparm nodlight
|
||||
|
||||
nopicmip
|
||||
nomipmaps
|
||||
|
||||
qer_editorimage textures/shaderlab_terrain/sky_clouds.tga
|
||||
|
||||
{
|
||||
map textures/shaderlab_terrain/sky_clouds.tga
|
||||
tcMod scale 3 3
|
||||
//tcMod scroll 0.005 -0.0125
|
||||
rgbGen identityLighting
|
||||
}
|
||||
{
|
||||
map textures/shaderlab_terrain/sky_arc_masked.tga
|
||||
blendFunc GL_ONE_MINUS_SRC_ALPHA GL_SRC_ALPHA
|
||||
tcMod transform 0.25 0 0 0.25 0.1075 0.1075
|
||||
rgbGen identityLighting
|
||||
}
|
||||
}
|
||||
</pre>
|
||||
|
||||
<p>Keep in mind that this is a generalized shader, and that there can be a lot of different variations to yield different effects. Take a look at some of the original Quake III Arena shaders for more examples. In this screenshot (compiled with LIGHT -fast, viewed with /r_lightmap 1), the effect isn't bad, but the shadows are a bit jagged.</p>
|
||||
|
||||
<img src="sky01.jpg" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/_images/sky01.jpg" width="416" height="316" alt="sky01" class="center" />
|
||||
|
||||
<p>Q3Map2 sky shaders improves on the way lightmaps are calculated, improving both quality and compiler performance. This is essentially the same shader with some small changes:</p>
|
||||
|
||||
<pre>
|
||||
textures/shadermanual/sky
|
||||
{
|
||||
skyparms textures/shaderlab_terrain/env/sky 1024 -
|
||||
|
||||
q3map_lightImage textures/shaderlab_terrain/sky_clouds.tga
|
||||
|
||||
q3map_sun 1 1 1 140 -35 25
|
||||
q3map_skylight 100 3 //amount iterations
|
||||
|
||||
surfaceparm sky
|
||||
surfaceparm noimpact
|
||||
surfaceparm nolightmap
|
||||
surfaceparm nodlight
|
||||
|
||||
nopicmip
|
||||
nomipmaps
|
||||
|
||||
qer_editorimage textures/shaderlab_terrain/sky_clouds.tga
|
||||
|
||||
{
|
||||
map textures/shaderlab_terrain/sky_clouds.tga
|
||||
tcMod scale 3 3
|
||||
//tcMod scroll 0.005 -0.0125
|
||||
rgbGen identityLighting
|
||||
}
|
||||
{
|
||||
map textures/shaderlab_terrain/sky_arc_masked.tga
|
||||
blendFunc GL_ONE_MINUS_SRC_ALPHA GL_SRC_ALPHA
|
||||
tcMod transform 0.25 0 0 0.25 0.1075 0.1075
|
||||
rgbGen identityLighting
|
||||
}
|
||||
}
|
||||
</pre>
|
||||
|
||||
<p>What we've done here is replace q3map_lightSubdivide and q3map_surfacelight with q3map_skylight which yields more uniform shadows at a fraction of the compile time. However, this also generates the "stadium light" effect - producing some unwanted shadows. We'll fix this later.</p>
|
||||
|
||||
<img src="sky02.jpg" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/_images/sky02.jpg" width="416" height="316" alt="sky02" class="center" />
|
||||
|
||||
<p>To solve the problem with jagged shadow edges, we can smooth out the shadows by blurring the lightmap. Depending on the type of lighting that you want to achieve for the sun (a cloudy day, for example), you can create a penumbra (half-shadow) effect using q3map_sunExt. This simulates the way sunlight bounces in certain conditions, creating a slight "jittering" effect. This is the same shader again with q3map_sunExt.</p>
|
||||
|
||||
<pre>
|
||||
textures/shadermanual/sky
|
||||
{
|
||||
skyparms textures/shaderlab_terrain/env/sky 1024 -
|
||||
|
||||
q3map_lightImage textures/shaderlab_terrain/sky_clouds.tga
|
||||
|
||||
q3map_sunExt 1 1 1 140 -35 25 3 16 //adds deviance and samples
|
||||
q3map_skylight 100 3
|
||||
|
||||
surfaceparm sky
|
||||
surfaceparm noimpact
|
||||
surfaceparm nolightmap
|
||||
surfaceparm nodlight
|
||||
|
||||
nopicmip
|
||||
nomipmaps
|
||||
|
||||
qer_editorimage textures/shaderlab_terrain/sky_clouds.tga
|
||||
|
||||
{
|
||||
map textures/shaderlab_terrain/sky_clouds.tga
|
||||
tcMod scale 3 3
|
||||
//tcMod scroll 0.005 -0.0125
|
||||
rgbGen identityLighting
|
||||
}
|
||||
{
|
||||
map textures/shaderlab_terrain/sky_arc_masked.tga
|
||||
blendFunc GL_ONE_MINUS_SRC_ALPHA GL_SRC_ALPHA
|
||||
tcMod transform 0.25 0 0 0.25 0.1075 0.1075
|
||||
rgbGen identityLighting
|
||||
}
|
||||
}
|
||||
</pre>
|
||||
|
||||
<p>In the following screenshot, you can see that the jagged shadow edges are gone.</p>
|
||||
|
||||
<img src="sky03.jpg" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/_images/sky03.jpg" width="416" height="316" alt="sky03" class="center" />
|
||||
|
||||
<p>As mentioned above, you may be faced with problems involving the "stadium lights" effect when using q3map_skyLight. We can eliminate this problem by using higher values for the q3map_sunExt samples and q3map_skyLight iterations parameter, but at the cost of a higher compile time. For example, q3map_sunExt 1 1 1 140 -35 25 3 32 and q3map_skylight 100 6.</p>
|
||||
|
||||
<blockquote>
|
||||
<h4>Note:</h4>
|
||||
<p>Since the time that these screenshots were taken, the skylight subdivision code has been greatly improved (Q3Map2 2.5.14) for far more uniform lighting and faster compiles, so using higher iteration values can result in better quality, reducing the "stadium light" effect and without necessarily increasing compile times.</p>
|
||||
</blockquote>
|
||||
|
||||
<img src="sky04.jpg" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/_images/sky04.jpg" width="416" height="316" alt="sky04" class="center" />
|
||||
|
||||
<p>A faster approximate alternative of getting rid of the "stadium lights" effect is to use q3map_lightmapFilterRadius.</p>
|
||||
|
||||
<pre>
|
||||
textures/shadermanual/sky
|
||||
{
|
||||
skyparms textures/shaderlab_terrain/env/sky 1024 -
|
||||
|
||||
q3map_lightImage textures/shaderlab_terrain/sky_clouds.tga
|
||||
|
||||
q3map_sunExt 1 1 1 140 -35 25 3 16
|
||||
q3map_lightmapFilterRadius 0 8 //self other
|
||||
q3map_skyLight 100 3
|
||||
|
||||
surfaceparm sky
|
||||
surfaceparm noimpact
|
||||
surfaceparm nolightmap
|
||||
surfaceparm nodlight
|
||||
|
||||
nopicmip
|
||||
nomipmaps
|
||||
|
||||
qer_editorimage textures/shaderlab_terrain/sky_clouds.tga
|
||||
|
||||
{
|
||||
map textures/shaderlab_terrain/sky_clouds.tga
|
||||
tcMod scale 3 3
|
||||
//tcMod scroll 0.005 -0.0125
|
||||
rgbGen identityLighting
|
||||
}
|
||||
{
|
||||
map textures/shaderlab_terrain/sky_arc_masked.tga
|
||||
blendFunc GL_ONE_MINUS_SRC_ALPHA GL_SRC_ALPHA
|
||||
tcMod transform 0.25 0 0 0.25 0.1075 0.1075
|
||||
rgbGen identityLighting
|
||||
}
|
||||
}
|
||||
</pre>
|
||||
|
||||
<p>The self and other parameters are the amount of filtering applied on the lightmap in world units. The self value is always set to "0" on sky shaders since skies don't have lightmaps. The q3map_lightmapFilterRadius directive should always be placed before any light-related directives that you want it to affect. In our case, we placed it after q3map_sunExt and before q3map_skyLight so that it filters the stadium lights, but won't blur the sun shadows which are already jittered. This produces very similar results without the long compile times.</p>
|
||||
|
||||
<img src="sky05.jpg" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/_images/sky05.jpg" width="416" height="316" alt="sky05" class="center" />
|
||||
|
||||
<p>Reference: Obsidian (2004). <a href="http://www.quake3world.com/ubb/Archives/Archive-000004/HTML/20040311-6-027331.html?" tppabs="http://www.quake3world.com/ubb/Archives/Archive-000004/HTML/20040311-6-027331.html?">Shader Lighting Experiment</a>, Quake3World (link currently down, <a href="http://web.archive.org/web/20050412214328/www.quake3world.com/ubb/Archives/Archive-000004/HTML/20040311-6-027331.html" tppabs="http://web.archive.org/web/20050412214328/www.quake3world.com/ubb/Archives/Archive-000004/HTML/20040311-6-027331.html">see here</a>).</p>
|
||||
|
||||
|
||||
<h2>Lighting Effects</h2>
|
||||
<p>(Pending)</p>
|
||||
<!--
|
||||
<p>Here are some additional features that you can use to create special lighting effects:</p>
|
||||
|
||||
*multiple suns by adding more than one q3map_sun or q3map_sunExt to shader
|
||||
*stuff about compiler switches
|
||||
*-skyfix
|
||||
*_skybox entity does not work with surfaceLight, must use skyLight
|
||||
-->
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
131
docs/shaderManual/lightstyles.html
Normal file
|
|
@ -0,0 +1,131 @@
|
|||
<?xml version="1.1" encoding="iso-8859-1"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
|
||||
<head>
|
||||
<title>Q3Map2 Shader Manual</title>
|
||||
<meta name="keywords" content="id software, quake, radiant, qeradiant, gtkradiant, q3map, q3map2, shader, manual, ydnar, obsidian" />
|
||||
<meta name="description" content="Q3Map2 Shader Manual" />
|
||||
<meta name="copyright" content="Obsidian © 2010" />
|
||||
<link rel="stylesheet" href="default.css" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/_css/default.css" type="text/css" media="all" title="Default styles" />
|
||||
</head>
|
||||
<body id="articles">
|
||||
|
||||
<div id="nav">
|
||||
<div id="navbutton">
|
||||
<ul>
|
||||
<div id="navtop"></div>
|
||||
<li><a href="index.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/index.html">Q3Map2 Shader Manual</a></li>
|
||||
<li><a href="contents.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/contents.html">Full Contents</a></li>
|
||||
<li>Introduction
|
||||
<ul>
|
||||
<li><a href="preface.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/preface.html">Preface</a></li>
|
||||
<li><a href="shader-concepts.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/shader-concepts.html">Shader Concepts</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Directives
|
||||
<ul>
|
||||
<li><a href="general-directives.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/general-directives.html">General Directives</a></li>
|
||||
<li><a href="q3map-global-directives.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-global-directives.html">Q3Map Global Directives</a></li>
|
||||
<li><a href="q3map-surface-parameter-directives.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-surface-parameter-directives.html">Q3Map Surface Parameter Directives</a></li>
|
||||
<li><a href="quake-editor-radiant-directives.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/quake-editor-radiant-directives.html">Quake Editor Radiant Directives</a></li>
|
||||
<li><a href="stage-directives.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/stage-directives.html">Stage Directives</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Articles
|
||||
<ul>
|
||||
<li><a href="texture-creation.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/texture-creation.html">Texture Creation</a></li>
|
||||
<li><a href="alpha-channels.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/alpha-channels.html">Alpha Channels</a></li>
|
||||
<li><a href="light-emitting-shaders.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/light-emitting-shaders.html">Light Emitting Shaders</a></li>
|
||||
<li><a href="lightstyles.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/lightstyles.html">Lightstyles</a></li>
|
||||
<li><a href="cel-shading.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/cel-shading.html">Cel Shading</a></li>
|
||||
<li><a href="decal-tricks.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/decal-tricks.html">Decal Tricks</a></li>
|
||||
<li><a href="foghull.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/foghull.html">Foghull</a></li>
|
||||
<li><a href="fur.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/fur.html">Fur</a></li>
|
||||
<li><a href="terrain-and-alphamod-blends.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/terrain-and-alphamod-blends.html">Terrain and alphaMod Blends</a></li>
|
||||
<li><a href="triggerable-shader-entities.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/triggerable-shader-entities.html">Triggerable Shader Entities</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<div id="navlow"></div>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h1>Lightstyles</h1>
|
||||
<p>Q3Map2 light styles are a way to simulate flickering/blinking dynamic lights by modulating values between up to 3 different dynamic lightmap styles per surface. This feature was added in Q3Map2 to support Quake 3 and RTCW. SOF2/JK2 already have native support for light styles. Light styles will only affect lightmapped objects, it has no effect on vertex lit objects and the light grid.</p>
|
||||
<img src="lightstyles.jpg" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/_images/lightstyles.jpg" width="416" height="316" alt="slstyle" class="center" />
|
||||
|
||||
<h2>Worldspawn Keys</h2>
|
||||
<p>To create some flickering lights, we need some waveform functions. These are set on the worldspawn entity in Radiant's Entity Inspector using two new available key/value pairs: _style<em>N</em>rgbGen and _style<em>N</em>alphaGen keys, where "N" is the style index number, an integer between 1 and 31. Both keys will take <a href="shader-concepts.html#waveformfunctions" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/shader-concepts.html#waveformfunctions">standard waveform functions</a> as values. As an example:</p>
|
||||
<pre>
|
||||
_style1alphaGen wave sin .5 .3 .25 1.5
|
||||
_style1rgbGen wave noise 0.5 1 0 5.37
|
||||
_style2alphaGen wave sin .8 .3 .25 1.5
|
||||
_slyle2rgbGen wave square -.3 1.3 0 5.3
|
||||
classname worldspawn
|
||||
</pre>
|
||||
|
||||
<h2>Lights</h2>
|
||||
<p>Next, we need to associate your lights with the style index numbers that were set in the worldspawn. You can add light styles to either light entities or light emitting shaders.</p>
|
||||
|
||||
<h3>Light Entities</h3>
|
||||
<p>With a light entity selected, open up the Entity Inspector and add a "style" key. Use a value between 1 and 31 matching the style index number previously set in the worldspawn.</p>
|
||||
|
||||
<h3>Light Emitting Shaders</h3>
|
||||
<p>You can also use q3map_lightStyle N, where "N" is a value between 1 and 31 matching the style index number set in the worldspawn, on light-emitting shaders to have them emit styled light.</p>
|
||||
<pre>
|
||||
textures/slstyle/light
|
||||
{
|
||||
q3map_surfacelight 3700
|
||||
q3map_lightStyle 1 // sets style index #1
|
||||
{
|
||||
map $lightmap
|
||||
rgbGen identity
|
||||
}
|
||||
q3map_styleMarker // note: after the $lightmap stage
|
||||
{
|
||||
map textures/slstyle/light.tga
|
||||
blendFunc GL_DST_COLOR GL_ZERO
|
||||
rgbGen identity
|
||||
}
|
||||
{
|
||||
map textures/slstyle/light.blend.tga
|
||||
blendfunc GL_ONE GL_ONE
|
||||
}
|
||||
}
|
||||
</pre>
|
||||
|
||||
<h2>Lightmapped Surfaces</h2>
|
||||
<p>For any shaders that may be hit by a styled light, you'll need to add q3map_styleMarker after the lightmap stages and before the texture stages so Q3Map2 can properly create the fake lightmap stages. For masked textures where a depthFunc equal is required, add q3map_styleMarker2.</p>
|
||||
<p>Shaders with lightmaps after texture passes will look odd. This may change in the future. Try to rearrange your shaders, if possible, to have lightmaps first.</p>
|
||||
<pre>
|
||||
textures/slstyle/plywood2sided
|
||||
{
|
||||
cull none
|
||||
qer_editorImage textures/slstyle/plywood-2-tone.tga
|
||||
{
|
||||
map $lightmap
|
||||
rgbGen identity
|
||||
}
|
||||
q3map_styleMarker // note: after the $lightmap stage
|
||||
{
|
||||
map textures/slstyle/plywood-2-tone.tga
|
||||
blendFunc GL_DST_COLOR GL_ZERO
|
||||
rgbGen identity
|
||||
}
|
||||
}
|
||||
</pre>
|
||||
|
||||
<h2>Compiling</h2>
|
||||
<p>Compile your map with Q3Map 2.5.5-test-6 or later. Be sure to use the -nocollapse switch in the -light phase. This is important, because styled lights generate shaders, and this minimizes the number of unique shaders.</p>
|
||||
<p>In game, you might get a warning message in the console, "WARNING: reused image *lightmap4 with mixed glWrapClampMode parm", which you can safely ignore.</p>
|
||||
|
||||
<h3>References</h3>
|
||||
<ul>
|
||||
<li><a href="http://www.splashdamage.com/forums/showthread.php?t=1857" tppabs="http://www.splashdamage.com/forums/showthread.php?t=1857">Q3Map 2.5.5-test-6 (lightstyles)</a>, ydnar 2003</li>
|
||||
<li><a href="http://shaderlab.com/q3map2/samples/map-slstyle.zip" tppabs="http://shaderlab.com/q3map2/samples/map-slstyle.zip">slstyle demo map</a> (<a href="http://robotrenegade.com/q3map2/downloads/samples/maps/map-slstyle.zip" tppabs="http://robotrenegade.com/q3map2/downloads/samples/maps/map-slstyle.zip">mirror</a>), ydnar 2003.</li>
|
||||
</ul>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
BIN
docs/shaderManual/lightstyles.jpg
Normal file
|
After Width: | Height: | Size: 28 KiB |
BIN
docs/shaderManual/nav.png
Normal file
|
After Width: | Height: | Size: 1.0 KiB |
BIN
docs/shaderManual/navlow.png
Normal file
|
After Width: | Height: | Size: 1.0 KiB |
BIN
docs/shaderManual/navtop.png
Normal file
|
After Width: | Height: | Size: 1.0 KiB |
103
docs/shaderManual/preface.html
Normal file
|
|
@ -0,0 +1,103 @@
|
|||
<?xml version="1.1" encoding="iso-8859-1"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
|
||||
<head>
|
||||
<title>Q3Map2 Shader Manual</title>
|
||||
<meta name="keywords" content="id software, quake, radiant, qeradiant, gtkradiant, q3map, q3map2, shader, manual, ydnar, obsidian" />
|
||||
<meta name="description" content="Q3Map2 Shader Manual" />
|
||||
<meta name="copyright" content="Obsidian © 2010" />
|
||||
<link rel="stylesheet" href="default.css" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/_css/default.css" type="text/css" media="all" title="Default styles" />
|
||||
</head>
|
||||
<body id="intro_preface">
|
||||
|
||||
<div id="nav">
|
||||
<div id="navbutton">
|
||||
<ul>
|
||||
<div id="navtop"></div>
|
||||
<li><a href="index.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/index.html">Q3Map2 Shader Manual</a></li>
|
||||
<li><a href="contents.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/contents.html">Full Contents</a></li>
|
||||
<li>Introduction
|
||||
<ul>
|
||||
<li><a href="preface.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/preface.html">Preface</a></li>
|
||||
<li><a href="shader-concepts.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/shader-concepts.html">Shader Concepts</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Directives
|
||||
<ul>
|
||||
<li><a href="general-directives.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/general-directives.html">General Directives</a></li>
|
||||
<li><a href="q3map-global-directives.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-global-directives.html">Q3Map Global Directives</a></li>
|
||||
<li><a href="q3map-surface-parameter-directives.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-surface-parameter-directives.html">Q3Map Surface Parameter Directives</a></li>
|
||||
<li><a href="quake-editor-radiant-directives.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/quake-editor-radiant-directives.html">Quake Editor Radiant Directives</a></li>
|
||||
<li><a href="stage-directives.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/stage-directives.html">Stage Directives</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Articles
|
||||
<ul>
|
||||
<li><a href="texture-creation.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/texture-creation.html">Texture Creation</a></li>
|
||||
<li><a href="alpha-channels.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/alpha-channels.html">Alpha Channels</a></li>
|
||||
<li><a href="light-emitting-shaders.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/light-emitting-shaders.html">Light Emitting Shaders</a></li>
|
||||
<li><a href="lightstyles.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/lightstyles.html">Lightstyles</a></li>
|
||||
<li><a href="cel-shading.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/cel-shading.html">Cel Shading</a></li>
|
||||
<li><a href="decal-tricks.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/decal-tricks.html">Decal Tricks</a></li>
|
||||
<li><a href="foghull.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/foghull.html">Foghull</a></li>
|
||||
<li><a href="fur.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/fur.html">Fur</a></li>
|
||||
<li><a href="terrain-and-alphamod-blends.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/terrain-and-alphamod-blends.html">Terrain and alphaMod Blends</a></li>
|
||||
<li><a href="triggerable-shader-entities.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/triggerable-shader-entities.html">Triggerable Shader Entities</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<div id="navlow"></div>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h1 id="q3map2edition">The Q3Map2 Edition</h1>
|
||||
<p>Q3Map2 is an updated version of the original Q3Map program used to compile .map files created in a level editor such as Radiant into .bsp files used by id Tech 3 games. Since it's introduction, ydnar has added so many new features and improved efficiency to the degree where Q3Map2 has become the standard compiling program for the level editing community as well as for many commercial games.</p>
|
||||
<p>The Q3Map2 Edition is built off of the original QeRadiant Shader Manual written by the staff at id Software, improving upon it by including new shader directives introduced by Q3Map2, while expanding on the original content.</p>
|
||||
<p>This is currently the second edition of the Q3Map2 Shader Manual. It has been rewritten and converted to W3C compliant XHTML 1.0 Strict specifications. It is currently an actively developed project so check back for updates.</p>
|
||||
|
||||
<h2 id="usingthemanual">Using the Manual</h2>
|
||||
<p>(Pending)</p>
|
||||
|
||||
<h2 id="credits">Credits</h2>
|
||||
|
||||
<h3>Q3Map2 Edition</h3>
|
||||
<dl>
|
||||
<dt>Author</dt>
|
||||
<dd>Obsidian</dd>
|
||||
<dt>Additional material</dt>
|
||||
<dd>ydnar</dd>
|
||||
<dd>TTimo</dd>
|
||||
</dl>
|
||||
|
||||
<h3>QeRadiant Shader Manual, Revision #12</h3>
|
||||
<dl>
|
||||
<dt>Author</dt>
|
||||
<dd>Paul Jaquays</dd>
|
||||
<dd>Brian Hook</dd>
|
||||
<dt>Additional material</dt>
|
||||
<dd>John Carmack</dd>
|
||||
<dd>Christian Antkow</dd>
|
||||
<dd>Kevin Cloud</dd>
|
||||
<dd>Adrian Carmack</dd>
|
||||
<dt>HTML conversion</dt>
|
||||
<dd>John Hutton</dd>
|
||||
</dl>
|
||||
|
||||
<h2 id="contact">Contact</h2>
|
||||
|
||||
<h3>Support Forums</h3>
|
||||
<ul>
|
||||
<li><a href="http://www.splashdamage.com/forums/forumdisplay.php?f=7" tppabs="http://www.splashdamage.com/forums/forumdisplay.php?f=7">SplashDamage</a></li>
|
||||
<li><a href="http://www.quake3world.com/forum/viewforum.php?f=10" tppabs="http://www.quake3world.com/forum/viewforum.php?f=10">Quake3World</a></li>
|
||||
</ul>
|
||||
|
||||
<h3>Shader Manual Development</h3>
|
||||
<p>The new official home for the Q3Map2 Shader Manual is now located at <a href="http://robotrenegade.com/" tppabs="http://robotrenegade.com/">robotrenegade</a>.</p>
|
||||
<p>Feel free to e-mail me (Obsidian) if you have any suggestions, comments or error corrections: obsidian-at-robotrenegade-dot-com</p>
|
||||
|
||||
<h2 id="legal">Legal</h2>
|
||||
<p>Quake, Quake III Arena, Quake Live and logos are registered trademarks of id Software, Inc.</p>
|
||||
<p>Q3Map2 and the Q3Map2 Shader Manual is not an id Software product and is not officially supported. Do not contact them for support.</p>
|
||||
<p>The Q3Map2 Shader Manual is protected under a Attribution-Noncommerical-Share Alike <a href="http://creativecommons.org/licenses/by-nc-sa/3.0/" tppabs="http://creativecommons.org/licenses/by-nc-sa/3.0/">Creative Commons license</a>. Some rights reserved.</p>
|
||||
441
docs/shaderManual/q3map-global-directives.html
Normal file
|
|
@ -0,0 +1,441 @@
|
|||
<?xml version="1.1" encoding="iso-8859-1"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
|
||||
<head>
|
||||
<title>Q3Map2 Shader Manual</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||
<meta name="keywords" content="id software, quake, radiant, qeradiant, gtkradiant, q3map, q3map2, shader, manual, ydnar, obsidian" />
|
||||
<meta name="description" content="Q3Map2 Shader Manual" />
|
||||
<meta name="copyright" content="Obsidian © 2010" />
|
||||
<link rel="stylesheet" href="default.css" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/_css/default.css" type="text/css" media="all" title="Default styles" />
|
||||
</head>
|
||||
<body id="dir_q3map">
|
||||
|
||||
<div id="nav">
|
||||
<div id="navbutton">
|
||||
<ul>
|
||||
<div id="navtop"></div>
|
||||
<li><a href="index.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/index.html">Q3Map2 Shader Manual</a></li>
|
||||
<li><a href="contents.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/contents.html">Full Contents</a></li>
|
||||
<li>Introduction
|
||||
<ul>
|
||||
<li><a href="preface.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/preface.html">Preface</a></li>
|
||||
<li><a href="shader-concepts.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/shader-concepts.html">Shader Concepts</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Directives
|
||||
<ul>
|
||||
<li><a href="general-directives.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/general-directives.html">General Directives</a></li>
|
||||
<li><a href="q3map-global-directives.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-global-directives.html">Q3Map Global Directives</a></li>
|
||||
<li><a href="q3map-surface-parameter-directives.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-surface-parameter-directives.html">Q3Map Surface Parameter Directives</a></li>
|
||||
<li><a href="quake-editor-radiant-directives.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/quake-editor-radiant-directives.html">Quake Editor Radiant Directives</a></li>
|
||||
<li><a href="stage-directives.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/stage-directives.html">Stage Directives</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Articles
|
||||
<ul>
|
||||
<li><a href="texture-creation.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/texture-creation.html">Texture Creation</a></li>
|
||||
<li><a href="alpha-channels.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/alpha-channels.html">Alpha Channels</a></li>
|
||||
<li><a href="light-emitting-shaders.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/light-emitting-shaders.html">Light Emitting Shaders</a></li>
|
||||
<li><a href="lightstyles.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/lightstyles.html">Lightstyles</a></li>
|
||||
<li><a href="cel-shading.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/cel-shading.html">Cel Shading</a></li>
|
||||
<li><a href="decal-tricks.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/decal-tricks.html">Decal Tricks</a></li>
|
||||
<li><a href="foghull.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/foghull.html">Foghull</a></li>
|
||||
<li><a href="fur.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/fur.html">Fur</a></li>
|
||||
<li><a href="terrain-and-alphamod-blends.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/terrain-and-alphamod-blends.html">Terrain and alphaMod Blends</a></li>
|
||||
<li><a href="triggerable-shader-entities.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/triggerable-shader-entities.html">Triggerable Shader Entities</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<div id="navlow"></div>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h1>Q3Map Global Directives</h1>
|
||||
<p>Q3Map2 global directives change the physical nature of the textures and the brushes that are marked with them. Changing any of these values will require the map to be re-compiled. These are global and affect the entire shader.</p>
|
||||
|
||||
<h2 id="q3map_alphaGen">q3map_alphaGen func</h2>
|
||||
<p>Currently takes a single function, const. This directive is used to set a surfaces vertex alpha values. q3map_alphaGen operations are applied to an object's vertexes so the alphaGen vertex directive is required for each affected stage.</p>
|
||||
|
||||
<h3>q3map_alphaGen const norm</h3>
|
||||
<p>Forces a fixed vertex alpha value to the entire shader surface, useful for controlling transparency or blending. Values are a normalized number.</p>
|
||||
|
||||
<h2 id="q3map_alphaMod">q3map_alphaMod func</h2>
|
||||
<p>This is used for special vertex alpha blending effects on surfaces by altering the vertex alpha values depending on specific surface properties, such as the surfaces normal axis or the vertexes contained within its volume. q3map_alphaMod operations are applied to an object's vertexes so the rgbGen vertex directive is required for each affected stage.</p>
|
||||
|
||||
<h3>q3map_alphaMod dotproduct ( X Y Z )</h3>
|
||||
<p>Used to blend textures using alphaFunc or blendFunc in the shader's second pass, with the transparency depending on the surface's normal axis vector. This is achieved by taking the user specified vector ( X Y Z ) and applying a dotproduct calculation with the generated vertex normal vector to yield a normalized vertex alpha value. The dot product operation multiplies each element of one vector against the corresponding elements of a second vector, then adds them:</p>
|
||||
<p>Used to blend textures using alphaFunc or blendFunc in the shader's second pass, with the transparency depending on the surface's normal axis vector. This is achieved by taking the user specified vector ( X Y Z ) and applying a dotproduct calculation with the generated vertex normal vector to yield a normalized vertex alpha value. The dot product operation multiplies each element of one vector against the corresponding elements of a second vector, then adds them:</p>
|
||||
<pre>
|
||||
( 0 0 1 ) dp ( 0 0 1 ) = 0 * 0 + 0 * 0 + 1 * 1 = 1
|
||||
( 0 0 1 ) dp ( 0 0 0.5 ) = 0 * 0 + 0 * 0 + 1 * 0.5 = 0.5
|
||||
( 0.5 0.5 1 ) dp ( 0 0.5 0.5 ) = 0.5 * 0 + 0.5 * 0.5 + 1 * 0.5 = 0.75
|
||||
</pre>
|
||||
<p>In a practical sense, you can think of the dotproduct vector ( 0 0 0.9 ) as meaning that all vertex normal vectors pointing straight up along the z-axis ( 0 0 1 ) will have a vertex alpha value of 90% opacity.</p>
|
||||
|
||||
<h3>q3map_alphaMod dotproduct2 ( X Y Z )</h3>
|
||||
<p>This works in a similar way to dotproduct except it exaggerates the differences in vertex normals by squaring the final dot product value. With the same values as the above example, dotproduct2 would give the following:</p>
|
||||
<pre>
|
||||
[ ( 0 0 1 ) dp ( 0 0 1 ) ]<sup>2</sup> = ( 0 * 0 + 0 * 0 + 1 * 1 )<sup>2</sup> = 1
|
||||
[ ( 0 0 1 ) dp ( 0 0 0.5 ) ]<sup>2</sup> = ( 0 * 0 + 0 * 0 + 1 * 0.5 )<sup>2</sup> = 0.25
|
||||
[ ( 0.5 0.5 1 ) dp ( 0 0.5 0.5 ) ]<sup>2</sup> = ( 0.5 * 0 + 0.5 * 0.5 + 1 * 0.5 )<sup>2</sup> = 0.5625
|
||||
</pre>
|
||||
<p>Example q3map_dotproduct shader for terrain:</p>
|
||||
<pre>
|
||||
textures/shaderlab_vector_1/rock_1_z_lodterrain
|
||||
{
|
||||
//Used for radiosity lighting
|
||||
q3map_lightImage textures/shaderlab_vector_1/rock_1.tga
|
||||
|
||||
q3map_nonplanar
|
||||
q3map_shadeAngle 179
|
||||
q3map_tcGen ivector ( 512 0 0 ) ( 0 512 0 )
|
||||
q3map_tcMod rotate 33
|
||||
q3map_lightmapAxis z
|
||||
|
||||
// this means dot product squared, for faster falloff between vertical and horizontal planes
|
||||
q3map_alphaMod dotproduct2 ( 0 0 0.95 )
|
||||
|
||||
surfaceparm nonsolid
|
||||
surfaceparm pointlight
|
||||
|
||||
{
|
||||
map textures/shaderlab_vector_1/rock_1.tga
|
||||
rgbGen vertex
|
||||
}
|
||||
{
|
||||
map textures/slterra/sand_1.tga
|
||||
blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
|
||||
rgbGen vertex
|
||||
}
|
||||
}
|
||||
</pre>
|
||||
<blockquote>
|
||||
<h4>Design Notes:</h4>
|
||||
<p>Typical examples of use include snow covering the top faces of objects, or terrain with grass growing on horizontal planes blending into rocky cliffs on near vertical surfaces. It is an excellent way of automatically creating realistic alpha-blended terrain without the complicated steps of setting up an alpha map.</p>
|
||||
</blockquote>
|
||||
|
||||
<h3>q3map_alphaMod scale norm</h3>
|
||||
<p>Used in conjunction with q3map_alphaMod volume. Scales the vertex alpha by the specified normalized number value.</p>
|
||||
|
||||
<h3>q3map_alphaMod set norm</h3>
|
||||
<p>Used in conjunction with q3map_alphaMod volume. Sets the vertex alpha (regardless of any previous alpha values) to the specified normalized number value.</p>
|
||||
|
||||
<h3>q3map_alphaMod volume</h3>
|
||||
<p>This was created as a way to explicitly set or modify the vertex alpha values of vertex points contained within a controlling brush volume marked with this shader directive. Applies all other q3map_alphaMod directives to each vertex inside a brush textured with this shader, allowing large faded scrolling fire shaders, waterfalls, marquees, explicit dotProduct terrain blending control, etc.
|
||||
</p>
|
||||
<blockquote>
|
||||
<h4>Design Notes:</h4>
|
||||
<p>This is usually used in special alphaMod volume "common" shaders for use within the editor only. A brush textured with the alphaMod volume shader is used to overlap the vertexes of another brush or model using an alpha-blended shader, altering the vertex alpha values. Worldspawn alphaMod volume brushes will affect all surfaces it comes in contact with. You can func_group an alphaMod volume brush to its affecting brush to localize the blend to just that entity.</p>
|
||||
</blockquote>
|
||||
|
||||
<h2 id="q3map_backShader">q3map_backShader shadername</h2>
|
||||
<p>This allows a brush to use a different shader when you are inside it looking out. By way of example, this would allow a water brush (or other) surfaces to have a different sort order or appearance when seen from the inside. q3map_backShader only works on brush faces. For this reason, it is often deprecated in favor of using q3map_cloneShader where the target shader contains q3map_invert. It can still be useful as a kind of shorthand.</p>
|
||||
|
||||
<h2 id="q3map_backSplash">q3map_backSplash percentage distance</h2>
|
||||
|
||||
<p>A surface light is lit by itself, often causing areas of higher light intensity than other areas. q3map_backSplash moves the light source away from the surface of the shader, allowing it to create smoother lighting over the face. By default, all shaders are assigned backsplash values, 5 for percentage, 23 units for distance.</p>
|
||||
|
||||
<dl>
|
||||
<dt>percentage</dt>
|
||||
<dd>Specifies the intensity percentage of the light generated by q3map_surfacelight to be redirected back at the surface. Use a value of 0 or a negative value to disable back splash lights.</dd>
|
||||
<dt>distance</dt>
|
||||
<dd>Distance of the back splash lights from the surface.</dd>
|
||||
</dl>
|
||||
|
||||
<h2 id="q3map_baseShader">q3map_baseShader shadername</h2>
|
||||
<p>Allows shaders to be subclassed (Q3Map2 relevant portions only, such as surfaceparms, lighting, texture projection, etc). Subclassed shaders can reference the base shader by referring to the base shader's name. In order for q3map_baseShader to work correctly, the base shader must be specified before any shaders that subclass it. Some EasyGen terrain templates incorrectly specified the base shader after the terrain shaders that depended on it, resulting in some interesting errors.</p>
|
||||
<p>This is fundamentally the reverse of q3map_remapShader. Use q3map_baseShader when a single group of q3map_* directives is required for multiple base shaders. Use q3map_remapShader when similar shaders are used that require different groups of q3map_* directives.</p>
|
||||
|
||||
<h2 id="q3map_bounce">q3map_bounce N.N</h2>
|
||||
<p>Deprecated! Use q3map_bounceScale instead.</p>
|
||||
|
||||
<h2 id="q3map_bounceScale">q3map_bounceScale N.N</h2>
|
||||
<p>Takes positive decimal number values between 0 and 1.0 (or higher), to scale the amount of light reflected in radiosity passes. You can oversaturate it by using a number higher than 1.0, but this can lead to excessive compile times. Using 90 would probably make things positively glacial. 1.0 is a default, fudged number that looked OK with the maps that were tested. Tweaking it to 1.5 or 2.0 won't hurt anything per se, but it does give you finer control over how each shader re-emits light. The poorly worded q3map_bounce has been renamed to q3map_bounceScale. While its use has been deprecated, q3map_bounce still works.</p>
|
||||
|
||||
<h2 id="q3map_clipModel">q3map_clipModel</h2>
|
||||
<p>Automatically clips misc_model entities for player and weapon collision. This should only be used on large models such as terrain (not small decorative models - manually clip those). The shader's surfaceparms are inherited by the magic clip brush, so if you have surfaceparm nonsolid in your model's shader that uses q3map_clipModel, then the brush will also be non-solid. This can also be set on a per model basis with the entity key/value pair, spawnflags 2.</p>
|
||||
|
||||
<h2 id="q3map_cloneShader">q3map_cloneShader shadername</h2>
|
||||
<p>A shader with this directive will inherit the target shader's properties and appearance. Be careful, this can lead to an infinite loop if a cloning shader references another cloning shader or itself.</p>
|
||||
|
||||
<h2 id="q3map_colorGen">q3map_colorGen func</h2>
|
||||
<p>Currently takes a single function, const. This directive is used to set a surfaces vertex color values. q3map_colorGen operations are applied to an object's vertexes so the rgbGen vertex directive is required for each affected stage. Same as q3map_rgbGen.</p>
|
||||
|
||||
<h3>q3map_colorGen const ( R G B )</h3>
|
||||
<p>Forces a fixed vertex color value to the entire shader surface.</p>
|
||||
|
||||
<h2 id="q3map_colorMod">q3map_colorMod func</h2>
|
||||
<p>Used to alter the vertex color values of vertexes contained within its volume. q3map_colorMod operations are applied to an object's vertexes so the rgbGen vertex directive is required for each affected stage. Possible uses include creating a neutral hued texture for a CTF middleground and then creating shader instances of the texture for red and blue bases. Same as q3map_rgbMod.</p>
|
||||
|
||||
<h3>q3map_colorMod scale ( R G B )</h3>
|
||||
<p>Used in conjunction with q3map_colorMod volume. Scales the vertex color by the specified color values.</p>
|
||||
|
||||
<h3>q3map_colorMod set ( R G B )</h3>
|
||||
<p>Used in conjunction with q3map_colorMod volume. Sets the vertex color to the specified color values.</p>
|
||||
|
||||
<h3>q3map_colorMod volume</h3>
|
||||
<p>This was created as a way to explicitly set or modify the vertex color values of vertex points contained within a controlling brush volume marked with this shader directive. Applies all other q3map_colorMod directives to each vertex inside a brush textured with this shader to change the hue of the affected surface.</p>
|
||||
<blockquote>
|
||||
<h4>Design Notes:</h4>
|
||||
<p>This is usually used in special colorMod volume "common" shaders for use within the editor only. A brush textured with the colorMod volume shader is used to overlap the vertexes of another brush or model, altering the vertex color values. Worldspawn colorMod volume brushes will affect all surfaces it comes in contact with. You can func_group a colorMod volume brush to its affecting brush to localize the hue to just that entity.</p>
|
||||
</blockquote>
|
||||
|
||||
<h3>q3map_colorMod dotproduct ( X Y Z )</h3>
|
||||
<h3>q3map_colorMod dotproduct2 ( X Y Z )</h3>
|
||||
<p>These ones work just like q3map_alphaMod dotproduct, but are modifying vertex color values.
|
||||
</p>
|
||||
|
||||
|
||||
<h2 id="q3map_fogDir">q3map_fogDir X Y Z</h2>
|
||||
<p>Specifies the direction a fog shader fades from transparent to opaque. Values indicate a directional vector.</p>
|
||||
|
||||
<h2 id="q3map_forceMeta">q3map_forceMeta</h2>
|
||||
<p>Forces model (MD3, ASE, etc.) surfaces to be broken down into their component triangles like brush faces and passed through the meta code on a per shader basis. This is required for lightmapped models. Setting spawnflags 4 on a misc_model will set q3map_forceMeta on all its surfaces.</p>
|
||||
|
||||
<h2 id="q3map_forceSunlight">q3map_forceSunlight</h2>
|
||||
<p>Obsolete! By default, no sunlight is cast on vertex-lit .md3 models or vertex-lit terrain. Using this option, sunlight (overbright bits created by the q3map_sun option) will be cast on these surfaces. q3map_forceSunlight is now obsolete since suns are now first class light sources.</p>
|
||||
|
||||
<h2 id="q3map_fur">q3map_fur layers offset fade</h2>
|
||||
<p>This is used for generating fur over a surface. This is typically used in conjunction with q3map_cloneShader in the surface (parent) shader and references the fur shader as the clone. A possible application of this is to create grass on alphablended terrain. Keep in mind that the use of a fur shader may cause a large hit to performance but when used sparingly, it can produce some interesting effects. (See Appendix: Fur)</p>
|
||||
|
||||
<dl>
|
||||
<dt>layers</dt><dd>This specifies the number of desired replicated fur layers generated.</dd>
|
||||
<dt>offset</dt><dd>The distance (in game units) between subsequent layers.</dd>
|
||||
<dt>fade</dt><dd>A normalized value indicating the fade falloff between subsequent layers.</dd>
|
||||
</dl>
|
||||
|
||||
<h2 id="q3map_globalTexture">q3map_globalTexture</h2>
|
||||
<p>Use this shader in the global directive commands whenever the tcMod scale function is used in one of the later render stages. Many problems with getting shader effects to work across multiple adjacent brushes are a result of the way Q3Map2 optimizes texture precision. This option resolves that, but at the expense of some precision of the textures when they are far away from the origin of the map.</p>
|
||||
|
||||
<h2 id="q3map_indexed">q3map_indexed</h2>
|
||||
<p>This is used for explicit terrain-style indexed mapping. It instructs Q3Map2 to look at the func_group terrain entity's _indexmap key for an image to pull index values from, and then to construct a shader name with the root based on the _shader key's value.</p>
|
||||
|
||||
<h2 id="q3map_invert">q3map_invert</h2>
|
||||
<p>Inverts a surface normal. Works on brush faces, models and patches. Used in celshading to achieve the inverted backfacing hull. Can be used with a shader that is targeted by q3map_cloneshader for something similar to q3map_backShader.</p>
|
||||
|
||||
<h2 id="q3map_lightImage">q3map_lightImage texturename</h2>
|
||||
<p>By default, surface lights use the average color of the source image to generate the color of the light. q3map_lightImage specifies an alternate image to be used for light color emission, radiosity color emission, light filtering and alpha shadows. You can even use a light image with a different alpha channel for blurrier alpha shadows. The light color is averaged from the referenced texture. The texture must be the same size as the base image map. q3map_lightImage should appear before qer_editorImage.</p>
|
||||
<p>The reason q3map_lightImage is specified for the light in the example below, is because the blend map is predominantly yellow, but the base image is not. The designer wanted the color of the light to be sampled from the blend map instead of the base image.
|
||||
<pre>
|
||||
textures/eerie/ironcrosslt2_10000
|
||||
{
|
||||
// this TGA is the source for the color of the blended light
|
||||
q3map_lightImage textures/gothic_light/ironcrosslt2.blend.tga
|
||||
|
||||
//editor TGA (used because the shader is used with several different light values)
|
||||
qer_editorImage textures/gothic_light/ironcrosslt2.tga
|
||||
|
||||
//emitted light value of 10,000
|
||||
q3map_surfacelight 10000
|
||||
|
||||
{
|
||||
//source texture is affected by the lightmap
|
||||
map $lightmap
|
||||
|
||||
// this command handles the overbright bits created by "sunlight" in the game
|
||||
rgbGen identity
|
||||
}
|
||||
{
|
||||
map textures/gothic_light/ironcrosslt2.tga
|
||||
blendFunc filter
|
||||
rgbGen identity
|
||||
}
|
||||
{
|
||||
maptextures/gothic_light/ironcrosslt2.blend.tga
|
||||
blendFunc add
|
||||
}
|
||||
}
|
||||
</pre>
|
||||
|
||||
<h2 id="q3map_lightmapAxis">q3map_lightmapAxis axis</h2>
|
||||
<p>Takes a single argument: either x, y or z as the direction from which the lightmap is projected from. The directive q3map_terrain has an implicit (read default) q3map_lightmapAxis defined as z. This directive is not recommended for things like caves or arches which have undersides.</p>
|
||||
|
||||
<h2 id="q3map_lightmapBrightness">q3map_lightmapBrightness N.N</h2>
|
||||
<p>Lightmap brightness scaling. A value of 2.0 will be twice as bright (linearly) and a value of 0.5 will be half as bright.</p>
|
||||
|
||||
<h2 id="q3map_lightmapFilterRadius">q3map_lightmapFilterRadius self other</h2>
|
||||
<p>This is usually used on light emitting shaders to approximate finer subdivided lighting. It adds a gaussian blur effect to the lightmaps of either the shader itself, or the surfaces affected by the shader, or both. The values for self and other are measured in world units of filtering (blurring) of lightmap data cast by any light sources.</p>
|
||||
<dl>
|
||||
<dt>self</dt><dd>Amount of blur set for the shader itself to approximate for the surfacelight's finer subdivided lighting. It should be set to 0 for sky shaders since they don't have lightmaps.</dd>
|
||||
<dt>other</dt><dd>Amount of blur set for other surfaces affected by this shader's emitted light. It should be set just high enough to eliminate the "stadium shadow" effect sometimes produced by q3map_skylight or to smooth out the lighting on surfacelights.</dd>
|
||||
</dl>
|
||||
<p>If using a value higher than 4 for the iterations parameter on q3map_skylight, you don't need q3map_lightmapFilterRadius as much, but at the expense of higher compile times. q3map_lightmapFilterRadius should be placed before any light related shader directives that you want it to affect. (see Appendix: Light Emitting Shaders)</p>
|
||||
|
||||
<h2 id="q3map_lightmapGamma">q3map_lightmapGamma N.N</h2>
|
||||
<p>Deprecated! Use q3map_lightmapBrightness instead.</p>
|
||||
|
||||
<h2 id="q3map_lightmapMergable">q3map_lightmapMergable</h2>
|
||||
<p>Allows surfaces like terrain to be mapped onto a single lightmap page for seamless terrain shadows. It will specify that the shaders using it can merge nonplanars together onto a single lightmap, so you can have a single 512x512 lightmap across a terrain entity. Note that most id Tech 3 engine games are limited to lightmap pages of 128x128. You may need to experiment with q3map_lightmapSize and the Q3Map2 -export general switch.</p>
|
||||
|
||||
<h2 id="q3map_lightmapSampleOffset">q3map_lightmapSampleOffset distance</h2>
|
||||
<p>Takes a single parameter, defaulting to 1.0, which specifies how many units off a surface should Q3Map2 sample lighting from. Use larger values (2.0-8.0) if you're getting ugly splotches on lightmapped terrain. Try to use filtering to solve splotches if possible, leaving q3MaplightmapSampleOffset as a last resort.</p>
|
||||
|
||||
<h2 id="q3map_lightmapSampleSize">q3map_lightmapSampleSize N</h2>
|
||||
<p>Surfaces using a shader with this option will have the pixel size of the lightmaps set to N world grid units. This option can be used to produce high-resolution shadows on certain surfaces. In addition, it can be used to reduce the size of lightmap data, where high-resolution shadows are not required, gaining memory and performance benefits. The default Quake III lightmap sample size is 16, smaller numbers increases lightmap resolution. In general, you should stick with power of 2 values.</p>
|
||||
|
||||
<h2 id="q3map_lightmapSize">q3map_lightmapSize width height</h2>
|
||||
<p>Specifies the size of the lightmap page that surface lightmaps get packed on to. Used mainly in Enemy Territory for terrain lightmaps (512x512) in concert with the Q3Map2 switch -lightmapsize. Most idTech 3 games will only support internal lightmap pages of 128x128. Larger pages will result in lightmaps exported externally from the .bsp file.</p>
|
||||
|
||||
<h2 id="q3map_lightRGB">q3map_lightRGB red green blue</h2>
|
||||
<p>This forces a specified color of light to be emitted from a surface or sky light, rather than sampling colors from a lightimage, editor image or the texture map. Three normalized color values of light are required for the red green blue parameters. This does not affect bounced light in radiosity or lightfilter.</p>
|
||||
|
||||
<h2 id="q3map_lightStyle">q3map_lightStyle N</h2>
|
||||
<p>Used to set light styles on surface lights for lightmap flickering/waveform effects. N takes the form of a number between 1 and 31, that references the corresponding style number set in the worldspawn entity. Equivalent to setting "style" "N" on a light entity (see Appendix: Lightstyles).</p>
|
||||
|
||||
<h2 id="q3map_lightSubdivide">q3map_lightSubdivide N</h2>
|
||||
<p>Used on surface lights (see q3map_surfacelight). Controls the distance between surface generated light sources for uniform lighting. It defaults to 120 game units, but can be made larger or smaller as needed (for light surfaces at the bottom of cracks, for example). This can be a dominant factor in processing time for Q3Map2 lighting. Can have an increasingly "darker" effect when used with -fast. Compensate by raising the surface light value. For sky shaders, use q3map_skylight instead (see Appendix: Light Emitting Shaders).</p>
|
||||
|
||||
<h2 id="q3map_noClip">q3map_noClip</h2>
|
||||
<p>You might have noticed that terrain has been made to not clip or t-junction anymore. It was causing too many issues, so a new parameter was added: q3map_noClip. Normally, Q3Map2 clips all faces to the BSP, and then takes the minimum polygon that encompasses all visible fragments. q3map_noClip forces Q3Map2 to uses the original brush faces (This is implicit for autosprite(2) surfaces). Therefore, if you map tidy, you could theoretically use q3map_noClip on all your shaders. q3map_noClip and q3map_noTJunc, when used in combination, will preserve mesh geometry exactly as you make it.</p>
|
||||
|
||||
<h2 id="q3map_noFast">q3map_noFast</h2>
|
||||
<p>When used on surfaces that emit light, this will disable -fast optimizations. This is useful for large areas of dim sky, where you want the dim light to reach all surfaces. This shader directive prevents fast from affecting dim sky surfaces. It is necessary, if you can't do a workaround with brighter skies or by using a larger q3map_lightSubdivide value.</p>
|
||||
|
||||
<h2 id="q3map_noFog">q3map_noFog</h2>
|
||||
<p>Volumes marked with a shader containing this directive will not be affected by fog. For example, it can be used on sky shaders to prevent the fog from affecting it.</p>
|
||||
|
||||
<h2 id="q3map_nonPlanar">q3map_nonPlanar</h2>
|
||||
<p>Instructs Q3Map2 to merge any adjacent triangles that don't lie in the same plane into a non-planar triangle soup. This allows shadows to be cast correctly across non-planar edges. It is typically used on lightmapped terrain shaders.</p>
|
||||
|
||||
<h2 id="q3map_normalImage">q3map_normalImage texturename</h2>
|
||||
<p>Allow the use of a normal (height) map to simulate textured bumpmapping. This isn't real bumpmapping per se, but generates a static lightmap image that reflects the normal map and light source.</p>
|
||||
|
||||
<h2 id="q3map_noTJunc">q3map_noTJunc</h2>
|
||||
<p>Read as "no T-Junc". With this option, surfaces modified by a shader are not used for T-junction fixing. q3map_noClip and q3map_noTJunc, used in combination will preserve mesh geometry exactly as you make it.</p>
|
||||
|
||||
<h2 id="q3map_noVertexLight">q3map_noVertexLight</h2>
|
||||
<p>Suppresses Q3Map2 from overwriting the BSP-phase set vertex RGB values.</p>
|
||||
|
||||
<h2 id="q3map_noVertexShadows">q3map_noVertexShadows</h2>
|
||||
<p>Obsolete! Vertex lighting code was rewritten a couple of times, rendering this directive irrelevant. Shaders that are used on misc_models or terrain were to use q3map_noVertexShadows to disable shadows being cast on the vertex lit surfaces. Casting shadows at small, misc_model objects often makes sense. However, having shadows on large, vertex lit terrain surfaces often looks bad. Shadows are not cast on forced_vertex_lit surfaces by default (shaders with pointlight).</p>
|
||||
|
||||
<h2 id="q3map_offset">q3map_offset N.N</h2>
|
||||
<p>Offsets a surface along the vertex normals by N.N units. Used in celshading for those black edges.</p>
|
||||
|
||||
<h2 id="q3map_patchShadows">q3map_patchShadows</h2>
|
||||
<p>Obsolete! When this option is used in conjunction with the original lighting algorithm (-light), surfaces with textures modified with this option will show shadows that are cast by curve patches. Curve patches do not cast shadows by default. You would usually force patches to cast shadows by using the -patchshadows Q3Map2 switch.</p>
|
||||
|
||||
<h2 id="q3map_remapShader">q3map_remapShader shadername</h2>
|
||||
<p>Allows shaders to be subclassed. Subclassed shaders can reference the remap shader by referencing the remap shader's name. In order for this to work, the remap shader must be specified before any shaders that references it. Subclassed shaders must contain Q3Map2 and editor relevant portions only (q3map_*, surfaceparm and qer_* directives).</p>
|
||||
<p>This is fundamentally the reverse of q3map_baseShader. Use q3map_baseShader when a single group of q3map_* directives is required for multiple base shaders. Use q3map_remapShader when similar shaders are used that require different groups of q3map_* directives.</p>
|
||||
<blockquote>
|
||||
<h4>Design Notes:</h4>
|
||||
<p>Since the subclassed shaders that are applied to geometry does not contain any texture stages, qer_editorImage is usually required in conjunction with q3map_remapShader.</p>
|
||||
</blockquote>
|
||||
|
||||
<h2 id="q3map_rgbGen">q3map_rgbGen func</h2>
|
||||
<p>Same as q3map_colorGen</p>
|
||||
|
||||
<h2 id="q3map_rgbMod">q3map_rgbMod func</h2>
|
||||
<p>Same as q3map_colorMod</p>
|
||||
|
||||
<h2 id="q3map_shadeAngle">q3map_shadeAngle angle</h2>
|
||||
<p>Specifies the breaking angle for phong shading. This allows for smooth shadows between brush faces like patches. The angle parameter is the angle between adjacent faces at which smoothing will start to occur. Typical values are usually in the 120-179 range.</p>
|
||||
|
||||
<h2 id="q3map_skylight">q3map_skylight amount iterations</h2>
|
||||
<p>This replaces q3map_surfacelight and q3map_lightSubdivide on sky surfaces for much faster and more uniform sky illumination. Amount is a brightness value, similar to what you would use in q3map_sun. Good values are between 50 and 200. Iterations is an exponential factor. 3 is the best value that balances speed and quality. Values of 4 and 5 are higher quality at the expense of higher compile time. Values below 3 are not too useful. See Appendix: Light Emitting Shaders.</p>
|
||||
|
||||
<h2 id="q3map_splotchFix">q3map_splotchFix</h2>
|
||||
<p>This is used on lightmapped model shaders if splotched lighting artifacts appear. Any shadows at the ambient/dark level will be flooded from neighbouring luxels. This gets rid of shadow acne, but a surface must be more or less uniformly lit or this looks ugly. Try using q3map_lightmapSampleOffset first before using this as a last resort.</p>
|
||||
|
||||
<h2 id="q3map_styleMarker">q3map_styleMarker</h2>
|
||||
<p>For use on shaders that accompany style lights. For any shaders that may be hit by a styled light, add q3map_styleMarker after the lightmap stage and before the texture stages so Q3Map2 can properly create the fake lightmap stages (see Appendix: Lightstyles).</p>
|
||||
|
||||
<h2 id="q3map_styleMarker2">q3map_styleMarker2</h2>
|
||||
<p>Similar to q3map_styleMarker except it is used on masked textures where a depthFunc equal is required.</p>
|
||||
|
||||
<h2 id="q3map_sun">q3map_sun red green blue intensity degrees elevation</h2>
|
||||
<p>This directive in a sky shader will create the illusion of light cast into a map by a single, infinitely distance parallel light source (sun, moon, hellish fire, etc.). This is only processed during the lighting phase of Q3Map2. While still perfectly usable, q3map_sun is now deprecated in favour of q3map_sunExt (see below).</p>
|
||||
|
||||
<h2 id="q3map_sunExt">q3map_sunExt red green blue intensity degrees elevation deviance samples</h2>
|
||||
<p>Works like q3map_sun with the addition of two new parameters to create "light jittering" for penumbra (half-shadow) effects. This gives you much more realistic shadows from the sun, especially when trying to simulate a cloudy day or a wide sun. The penumbra effect can also be applied to entity lights (point, spot or sun) with the _deviance N (distance in world units for point/spot lights and degrees for suns) and _samples N (number of samples) key/value pairs.</p>
|
||||
<dl>
|
||||
<dt>red green blue</dt><dd>Color is described by three normalized RGB values. Color will be normalized to a 0.0 to 1.0 range, so it doesn't matter what range you use.</dd>
|
||||
<dt>intensity</dt><dd>The brightness of the generated light. A value of 100 is a fairly bright sun. The intensity of the light falls off with angle but not distance.</dd>
|
||||
<dt>degrees</dt><dd>The angle relative to the directions of the map file. A setting of 0 degrees equals east. 90 is north, 180 is west and 270 is south. In the original version of Q3Map, non-axial values had a tendency to produce jagged shadows. With Q3Map2, this problem is avoided with new options like lightmap filtering, raytracing and penumbra effects.</dd>
|
||||
<dt>elevation</dt><dd>The distance, measured in degrees from the horizon (z value of zero in the map file). An elevation of 0 is sunrise/sunset. An elevation of 90 is noon.</dd>
|
||||
<dt>deviance</dt><dd>The number of degrees for the half-shadow. General values up to 2 or 3 are acceptable. The real sun has a solid angle of about half a degree.</dd>
|
||||
<dt>samples</dt><dd>The number of random jitters distributed over the solid arc (~16).</dd>
|
||||
</dl>
|
||||
<blockquote>
|
||||
<h4>Design Notes:</h4>
|
||||
<p>Sky shaders should probably still have a q3map_surfacelight or preferred q3map_skylight value. The "sun" gives a strong directional light, but doesn't necessarily give the fill light needed to soften and illuminate shadows. Skies with clouds should probably have a weaker q3map_sun value and a higher q3map_surfacelight or q3map_skylight value. Heavy clouds diffuse light and weaken shadows. The opposite is true of a cloudless or nearly cloudless sky. In such cases, the "sun" or "moon" will cast stronger shadows that have a greater degree of contrast. This is also why q3map_sunExt is preferred. It gives the designer greater control over shadow contrast with a penumbra effect.</p>
|
||||
<h4>Design Notes:</h4>
|
||||
<p>Not certain what color formula you want to use for the sun's light? Try this. Create a light entity. Use the Radiant editor's color selection tools to pick a color. The light's _color key's value will be the normalized RGB formula. Copy it from the value line in the editor (CTRL+c) and paste it into your shader.</p>
|
||||
</blockquote>
|
||||
|
||||
<h2 id="q3map_surfaceLight">q3map_surfaceLight value</h2>
|
||||
<p>The texture gives off light equal to the value set for it. The relative surface area of the texture in the world affects the actual amount of light that appears to be radiated. To give off what appears to be the same amount of light, a smaller texture must be significantly brighter than a larger texture. Unless the q3map_lightImage or q3map_lightRGB directive is used to select a different source for the texture's light color information, the color of the light will be the averaged color of the texture. For sky shaders, use q3map_skylight instead for faster and more uniform sky illumination.</p>
|
||||
|
||||
<h2 id="q3map_surfaceModel">q3map_surfaceModel modelpath density odds minscale maxscale minangle maxangle oriented</h2>
|
||||
<p>A surface with q3map_surfaceModel in its shader will randomly place a specified model across it's face. This is designed to place grass or tree models over terrain.</p>
|
||||
<dl>
|
||||
<dt>modelpath</dt><dd>The path to the model file (any supported format).</dd>
|
||||
<dt>density</dt><dd>The density of the models, in game units.</dd>
|
||||
<dt>odds</dt><dd>The odds of the model appearing (normalized?).</dd>
|
||||
<dt>minscale</dt><dd>The minimum scale of the model from its original size of 1.0.</dd>
|
||||
<dt>maxscale</dt><dd>The maximum scale of the model from its original size of 1.0.</dd>
|
||||
<dt>minangle</dt><dd>The model's minimum angle of rotation.</dd>
|
||||
<dt>maxangle</dt><dd>The model's maximum angle of rotation.</dd>
|
||||
<dt>oriented</dt><dd>This is a flag, either 0 or 1, and sets whether the model gets fitted to the orientation of the surface.</dd>
|
||||
</dl>
|
||||
|
||||
<h2 id="q3map_tcGen">q3map_tcGen func</h2>
|
||||
<p>This currently supports two functions, vector and ivector. Both functions are used for texture projection and do the exact same thing. The only difference is in the math, ivector was designed to be more intuitive.</p>
|
||||
|
||||
<h3>q3map_tcGen vector sVector tVector</h3>
|
||||
<p>Projects a texture Ns units by Nt units along a chosen axis. q3map_tcGen vector ( 1/256 0 0 ) ( 0 1/256 0 ) will project a texture every 256 units in x, and every 256 units in y, along the z-axis.</p>
|
||||
|
||||
<h3>q3map_tcGen ivector 1.0/sVector 1.0/tVector</h3>
|
||||
<p>Projects a texture Ns units by Nt units along a chosen axis. q3map_tcGen ivector ( 256 0 0 ) ( 0 256 0 ) will project a texture every 256 units in x, and every 256 units in y, along the z-axis. Ivector means inverse vector, and this means you won't have to do the divide with a calculator. Inverse = 1.0/n, unless the value is 0, then the matrix value is set to 0. A bit of dodgy math, but it works.</p>
|
||||
|
||||
<h2 id="q3map_tcMod">q3map_tcMod func</h2>
|
||||
<p>This works in a similar manner to the stage specific tcMod directive (see Stage Directives: tcMod), except in the compiler, so that modified texture coordinates are "baked" into the surface. This lets you set up less obvious texture tiling on natural and organic surfaces (especially terrain).</p>
|
||||
|
||||
<h3>q3map_tcMod rotate degrees</h3>
|
||||
<p>Rotates the texture (around origin, not center) a specified number of degrees.</p>
|
||||
|
||||
<h3>q3map_tcMod scale s-scale t-scale</h3>
|
||||
<p>Scales S (x) and T (y) texture co-ordinates. scale 2 2 would halve the size of the texture (doubling the texture co-ordinates).</p>
|
||||
|
||||
<h3>q3map_tcMod translate or move or shift s-offset t-offset</h3>
|
||||
<p>Shifts texture co-ordinates by S, T amount. translate 0.5 0 would shift it one-half in S, and none in T.</p>
|
||||
|
||||
<h2 id="q3map_terrain">q3map_terrain</h2>
|
||||
<p>Alphamap terrain shaders (typically textures/common/terrain and terrain2) must have the q3map_terrain directive. Terrain is handled completely differently from previous versions. Q3Map2 no longer looks for the word terrain in the shader name to determine whether or not it is an indexed shader. It looks for q3map_indexed, or q3map_terrain, which then sets off a bunch of stuff shoehorned into it, like: the lightmap axis, texture projection, etc.</p>
|
||||
<p>By default, q3map_terrain sets the following:</p>
|
||||
<pre>
|
||||
q3map_tcGen ivector ( 32 0 0 ) ( 0 32 0 )
|
||||
q3map_lightmapAxis z
|
||||
q3map_nonplanar
|
||||
q3map_shadeAngle 180 //(maybe 175?)
|
||||
q3map_indexed
|
||||
</pre>
|
||||
|
||||
<h2 id="q3map_tessSize">q3map_tessSize amount</h2>
|
||||
<p>This controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes directive. Abuse of this can create a huge number of triangles. This happens during Q3Map2 processing, so maps must be reprocessed for changes to take effect. The poorly named tessSize directive still works but has been deprecated in favour of q3map_tessSize for consistency.</p>
|
||||
<blockquote>
|
||||
<h4>Design Notes:</h4>
|
||||
<p>It can also be used on tessellating surfaces to make sure that tessellations are large and thus, less costly in terms of triangles created.</p>
|
||||
</blockquote>
|
||||
|
||||
<h2 id="q3map_textureSize">q3map_textureSize X Y</h2>
|
||||
<p>Deprecated. Useful when you don't specify an editor or light image for a shader. Recent builds of Q3Map2 will find some referenced image in a shader and use that as a fallback. Historically, this was used for surface splitting for RTCW for PS2, to accommodate the hardware's limited texture range precision.</p>
|
||||
|
||||
<h2 id="q3map_traceLight">q3map_traceLight</h2>
|
||||
<p>Obsolete! Surfaces using a shader with this option will always be lit with the original light algorithm. Patches will not cast shadows on this surface, unless the shader option q3map_patchShadows is also used.</p>
|
||||
|
||||
<h2 id="q3map_vertexScale">q3map_vertexScale N.N</h2>
|
||||
<p>The light value, at the vertices of a surface using a shader with this option, is multiplied by the scale value. This is a way to lighten, or darken, a vertex_lit surface, in comparison to other lightmap_lit surfaces around it. Values must be normalized.</p>
|
||||
|
||||
<h2 id="q3map_vertexShadows">q3map_vertexShadows</h2>
|
||||
<p>Obsolete! (See q3map_noVertexShadows) By default, no shadows are cast on vertex_lit_surfaces (see surfaceparm pointlight). In addition, when running Quake III Arena in vertex light, no shadows are cast upon any surface at all, since shadows are part of the lightmap. When using this shader directive, shadows will be cast on surfaces that are vertex lit. However, sharp shadow edges won't be seen on the surfaces, since light values are only calculated at the vertices.</p>
|
||||
|
||||
<h2 id="q3map_vlight">q3map_vlight</h2>
|
||||
<p>Obsolete!</p>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
198
docs/shaderManual/q3map-surface-parameter-directives.html
Normal file
|
|
@ -0,0 +1,198 @@
|
|||
<?xml version="1.1" encoding="iso-8859-1"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
|
||||
<head>
|
||||
<title>Q3Map2 Shader Manual</title>
|
||||
<meta name="keywords" content="id software, quake, radiant, qeradiant, gtkradiant, q3map, q3map2, shader, manual, ydnar, obsidian" />
|
||||
<meta name="description" content="Q3Map2 Shader Manual" />
|
||||
<meta name="copyright" content="Obsidian © 2010" />
|
||||
<link rel="stylesheet" href="default.css" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/_css/default.css" type="text/css" media="all" title="Default styles" />
|
||||
</head>
|
||||
<body id="dir_surfaceparm">
|
||||
|
||||
<div id="nav">
|
||||
<div id="navbutton">
|
||||
<ul>
|
||||
<div id="navtop"></div>
|
||||
<li><a href="index.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/index.html">Q3Map2 Shader Manual</a></li>
|
||||
<li><a href="contents.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/contents.html">Full Contents</a></li>
|
||||
<li>Introduction
|
||||
<ul>
|
||||
<li><a href="preface.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/preface.html">Preface</a></li>
|
||||
<li><a href="shader-concepts.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/shader-concepts.html">Shader Concepts</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Directives
|
||||
<ul>
|
||||
<li><a href="general-directives.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/general-directives.html">General Directives</a></li>
|
||||
<li><a href="q3map-global-directives.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-global-directives.html">Q3Map Global Directives</a></li>
|
||||
<li><a href="q3map-surface-parameter-directives.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-surface-parameter-directives.html">Q3Map Surface Parameter Directives</a></li>
|
||||
<li><a href="quake-editor-radiant-directives.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/quake-editor-radiant-directives.html">Quake Editor Radiant Directives</a></li>
|
||||
<li><a href="stage-directives.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/stage-directives.html">Stage Directives</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Articles
|
||||
<ul>
|
||||
<li><a href="texture-creation.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/texture-creation.html">Texture Creation</a></li>
|
||||
<li><a href="alpha-channels.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/alpha-channels.html">Alpha Channels</a></li>
|
||||
<li><a href="light-emitting-shaders.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/light-emitting-shaders.html">Light Emitting Shaders</a></li>
|
||||
<li><a href="lightstyles.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/lightstyles.html">Lightstyles</a></li>
|
||||
<li><a href="cel-shading.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/cel-shading.html">Cel Shading</a></li>
|
||||
<li><a href="decal-tricks.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/decal-tricks.html">Decal Tricks</a></li>
|
||||
<li><a href="foghull.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/foghull.html">Foghull</a></li>
|
||||
<li><a href="fur.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/fur.html">Fur</a></li>
|
||||
<li><a href="terrain-and-alphamod-blends.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/terrain-and-alphamod-blends.html">Terrain and alphaMod Blends</a></li>
|
||||
<li><a href="triggerable-shader-entities.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/triggerable-shader-entities.html">Triggerable Shader Entities</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<div id="navlow"></div>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h1>Q3Map Surface Parameter Directives</h1>
|
||||
<p>All surfaceparm keywords are preceded by the word surfaceparm as follows: surfaceparm fog or surfaceparm noimpact.</p>
|
||||
<p>These keywords change the physical nature of the textures and the brushes that are marked with them. Changing any of these values will require the map to be re-compiled. These are global and affect the entire shader.</p>
|
||||
<p>It should be noted that some of these surface parameters will change both the surface as well as the content of an object (surfaceparm water, for example). Shaders containing content altering surface parameters should usually be used on all sides of the object.</p>
|
||||
<p>Many of these keywords are only used in "common" shaders (baseq3/scripts/common.shader), which are editor specific shaders used by the level designer. Such keywords are usually not used for the design of custom assets.</p>
|
||||
<p>Originally, surfaceparm's were part of the previous chapter since they are actually Q3Map2 specific keywords. I've moved them into their own chapter for the sake of being easier to reference, since both this and the previous chapter were getting too long.</p>
|
||||
|
||||
<h2 id="alphashadow">surfaceparm alphashadow</h2>
|
||||
<p>This keyword applied to a texture on a brush, patch or model will cause the lighting phase of the Q3Map2 process to use the texture's alpha channel as a mask for casting static shadows in the game world.</p>
|
||||
<blockquote>
|
||||
<h4><h4>Design Notes:</h4></h4>
|
||||
<p>Alphashadow does not work well with fine line detail on a texture. Fine lines may not cast acceptable shadows. It appears to work best with well-defined silhouettes and wider lines within the texture. Most of our tattered banners use this to cast tattered shadows.</p>
|
||||
<p>With Q3Map2, it is possible to increase the resolution of the lightmap receiving the shadows at the cost to video memory. This can be achieved with the q3map_lightmapSampleSize keyword on the shadow receiving shader or by creating a func_group of the shadow receiving brushes and adding the _lightmapScale key with a floating-point value for the scale of the lightmap.</p>
|
||||
</blockquote>
|
||||
|
||||
<h2 id="antiportal">surfaceparm antiportal</h2>
|
||||
<p>Works like hint brushes in that it creates BSP nodes, but unlike hint, it blocks vis by not creating a portal at the split. This is designed to be used with large terrain maps to block visibility without having to resort to tricks like sky or caulk brushes penetrating the terrain and throwing ugly shadows.</p>
|
||||
|
||||
<img src="antiportal_sm.jpg" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/_images/antiportal_sm.jpg" alt="antiportal" class="center" />
|
||||
<p>Players in part A of the map will not be able to see into part B and vice-versa. You can walk through the antiportal just fine. Note that this also blocks light. There are two caveats: They are opaque to light, and if aligned to another BSP cut (such as blocksize or the origin) they will not function correctly. Don't align it with anything else (like blocksize or another brush face) and it'll block vis. This keyword is found in "common/antiportal" so you shouldn't need to specify this. "common/antiportal" was added by ydnar, so if you're missing this shader, it is included with the latest version of Q3Map2.</p>
|
||||
|
||||
<h2 id="areaportal">surfaceparm areaportal</h2>
|
||||
<p>A brush marked with this keyword functions as an areaportal, a break in the BSP tree. It is typically placed on a very thin brush placed inside a door entity (but is not a part of that entity). The intent is to block the game from processing surface triangles located behind it when the door is closed. It is also used by the BSPC (bot area file creation compiler) in the same manner as a clusterportal. The brush must touch all the structural brushes surrounding the areaportal. This keyword is found in "common/areaportal" so you shouldn't need to specify this.</p>
|
||||
|
||||
<h2 id="botclip">surfaceparm botclip</h2>
|
||||
<p>Blocks bot movement only. Other game world entities and human players can pass through a brush marked botclip. The intended use for this is to block the bot but not other players or projectiles. This keyword is found in "common/botclip" so you shouldn't need to specify this.</p>
|
||||
<blockquote>
|
||||
<h4>Design Notes:</h4>
|
||||
<p>Careful use of botclip in a map can greatly reduce the complexity of the .aas bot navigation file, resulting in "smarter", more efficient bots.</p>
|
||||
</blockquote>
|
||||
|
||||
<h2 id="clusterportal">surfaceparm clusterportal</h2>
|
||||
<p>A brush marked with this keyword function creates a subdivision of the area file (.aas) used by the bots for navigation. It is typically placed in locations that are natural breaks in a map, such as entrances to halls, doors, tunnels, etc. The intent is keep the bot from having to process the entire map at once. As with the the areaportal parameter, the affected brush must touch all the structural brushes surrounding the clusterportal. This keyword is found in "common/clusterportal" so you shouldn't need to specify this.</p>
|
||||
|
||||
<h2 id="detail">surfaceparm detail</h2>
|
||||
<p>This surface attribute causes a brush to be ignored by the Q3Map2 process for generating possible break-points in the BSP tree. Generally speaking, detail brushes are usually set in the editor, so you shouldn't need to specify this.</p>
|
||||
|
||||
<h2 id="donotenter">surfaceparm donotenter</h2>
|
||||
<p>Read as "do not enter". Like clusterportal, this is a bot-only property. A brush marked with donotenter will not affect non-bot players, but bots will not enter it. It should be used only when bots appear to have difficulty navigating around some map features. This does not physically stop the bot from entering a region (as with botclip). Bots will not enter the area on their own but may, for example, be blasted into the region with a rocket launcher. This keyword is found in "common/donotenter" so you shouldn't need to specify this.</p>
|
||||
<blockquote>
|
||||
<h4>Design Notes:</h4>
|
||||
<p>donotenter can be (sparingly) used in space maps around the void or around lava/slime in certain places where bots have an overwhelming tendancy to commit suicide (lemming style).</p>
|
||||
</blockquote>
|
||||
|
||||
<h2 id="dust">surfaceparm dust</h2>
|
||||
<p>If a player lands on a surface that uses a shader with this parameter, a puff of dust will appear at the player's feet. Note that the worldspawn entity must contain the "enabledust" key with a set value of "1".</p>
|
||||
|
||||
<h2 id="flesh">surfaceparm flesh</h2>
|
||||
<p>This will cue different sounds (in a similar manner to metalsteps) and cause blood to appear instead of bullet impact flashes. Actually, the code for this was never fully implemented by id Software. It remains half-finished so unfortunately it doesn't work.</p>
|
||||
|
||||
<h2 id="fog">surfaceparm fog</h2>
|
||||
<p>fog defines the brush as being a "fog" brush. This is a Q3Map2 function that chops and identifies all geometry inside the brush. The general shader keyword fogparms must also be specified to tell how to draw the fog.</p>
|
||||
|
||||
<h2 id="hint">surfaceparm hint</h2>
|
||||
<p>When Q3Map2 calculates the vis data, it tries to place portals in places in the map in an attempt to limit the potential viewable set (PVS). Brushes marked by a hint shader are used to manually place portals to force a break in the PVS. This keyword is found in "common/hint" so you shouldn't need to specify this.</p>
|
||||
|
||||
<h2 id="ladder">surfaceparm ladder</h2>
|
||||
<p>Supposedly used to allow the player to climb vertically. This is not functional in Quake III Arena.</p>
|
||||
|
||||
<h2 id="lava">surfaceparm lava</h2>
|
||||
<p>Assigns to the texture the game properties set for lava. This affects both the surface and the content of a brush.</p>
|
||||
|
||||
<h2 id="lightfilter">surfaceparm lightfilter</h2>
|
||||
<p>Causes the Q3Map2 light stage to use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.</p>
|
||||
|
||||
<h2 id="lightgrid">surfaceparm lightgrid</h2>
|
||||
<p>The min/max bounds of brushes with this shader in a map will define the bounds of the map's lightgrid (model lighting). Make it as small as possible around player space to minimize bsp size and compile time. This keyword is found in "common/lightgrid" so you shouldn't need to specify this. "common/lightgrid" was added by ydnar, so if you're missing this shader, it is included with the latest version of Q3Map2.</p>
|
||||
|
||||
<h2 id="metalsteps">surfaceparm metalsteps</h2>
|
||||
<p>The player sounds as if he is walking on clanging metal steps or gratings. Other than specifying flesh (doesn't work), metalsteps, nosteps, or default (i.e. specify nothing) it is currently not possible for a designer to create or assign a specific sound routine to a texture. Note: If no sound is set for a texture, then the default footsteps sound routines are heard.</p>
|
||||
|
||||
<h2 id="monsterclip">surfaceparm monsterclip</h2>
|
||||
<p>Blocks monster movement. Not functional in Quake III Arena.</p>
|
||||
|
||||
<h2 id="nodamage">surfaceparm nodamage</h2>
|
||||
<p>The player takes no fall damage if he lands onto a texture with this surfaceparm. This keyword is found in "common/cushion" but you may want to specify this on certain shaders (jump pads, for example).</p>
|
||||
|
||||
<h2 id="nodlight">surfaceparm nodlight</h2>
|
||||
<p>Read as "No Dee-Light". A texture containing this parameter will not be affected or lit by dynamic lights, such as weapon effects. An example in Quake III Arena would be solid lava.</p>
|
||||
|
||||
<h2 id="nodraw">surfaceparm nodraw</h2>
|
||||
<p>A texture marked with nodraw will not visually appear in the game world. Most often used for triggers, clip brushes, origin brushes, shaders with cull none or cull disable and so on. This keyword is found in "common/nodraw" so you shouldn't need to specify this.</p>
|
||||
|
||||
<h2 id="nodrop">surfaceparm nodrop</h2>
|
||||
<p>When a player dies inside a volume (brush) marked nodrop, no weapon is dropped. The intend use is for "Pits of Death." Have a kill trigger inside a nodrop volume, and when the players die here, they won't drop their weapons. The intent is to prevent unnecessary polygon pileups on the floors of pits. This keyword is found in "common/nodrop" but you may want to specify this on certain shaders (fog volumes in pits, for example).</p>
|
||||
|
||||
<h2 id="noimpact">surfaceparm noimpact</h2>
|
||||
<p>World entities will not impact on this texture. No explosions occur when projectiles strike this surface and no marks will be left on it. Sky textures are usually marked with this texture so those projectiles will not hit the sky and leave marks.</p>
|
||||
|
||||
<h2 id="nomarks">surfaceparm nomarks</h2>
|
||||
<p>Projectiles will explode upon contact with this surface, but will not leave marks. Blood will also not mark this surface. This is useful to keep lights from being temporarily obscured by battle damage.</p>
|
||||
<blockquote>
|
||||
<h4>Design Notes:</h4>
|
||||
<p>Use this on any surface with a deformVertexes keyword. Otherwise, the marks will appear on the unmodified surface location of the texture with the surface wriggles and squirms through the marks.</p>
|
||||
</blockquote>
|
||||
|
||||
<h2 id="nolightmap">surfaceparm nolightmap</h2>
|
||||
<p>This texture does not have a lightmap phase. It is not affected by the ambient lighting of the world around it. It does not require the addition of an rgbGen identity keyword in that stage.</p>
|
||||
|
||||
<h2 id="nosteps">surfaceparm nosteps</h2>
|
||||
<p>The player makes no sound when walking on this texture.</p>
|
||||
|
||||
<h2 id="nonsolid">surfaceparm nonsolid</h2>
|
||||
<p>This attribute indicates a brush, which does not block the movement of entities in the game world. It applied to triggers, hint brushes and similar brushes. This affects the content of a brush.</p>
|
||||
|
||||
<h2 id="origin">surfaceparm origin</h2>
|
||||
<p>Used on the "origin" texture. Rotating entities need to contain an origin brush in their construction. The brush must be rectangular (or square). The origin point is the exact center of the origin brush. This keyword is found in "common/origin" so you shouldn't need to specify this.</p>
|
||||
|
||||
|
||||
<h2 id="playerclip">surfaceparm playerclip</h2>
|
||||
<p>Blocks player movement through a nonsolid texture. Other game world entities can pass through a brush marked playerclip. The intended use for this is to block the player but not block projectiles like rockets. This keyword is found in "common/clip" so you shouldn't need to specify this.</p>
|
||||
<blockquote>
|
||||
<h4>Design Notes:</h4>
|
||||
<p>playerclip is often useful for "smoothing" out the geometry of the map, preventing the player from snagging on objects. It is also used in open sky areas of maps, preventing the player from flying too high and seeing the "Hall of Mirrors" effect at the bottom of the cloud layer.</p>
|
||||
</blockquote>
|
||||
|
||||
<h2 id="pointlight">surfaceparm pointlight</h2>
|
||||
<p>Surfaces using a shader with this parameter will always be vertex lit. This option can be used to reduce the lightmap data. It is often used on surfaces that don't need shadows. Basically the same as surfaceparm nolightmap.</p>
|
||||
|
||||
<h2 id="skip">surfaceparm skip</h2>
|
||||
<p>Works just like Quake II skip texture. Use on sides of hint and antiportal brushes where you don't want BSP splits. This keyword is found in "common/skip" so you shouldn't need to specify this. "common/skip" was added by ydnar, so if you're missing this shader, it is included with the latest version of Q3Map2.</p>
|
||||
|
||||
<h2 id="sky">surfaceparm sky</h2>
|
||||
<p>This flags the compiler, telling it that this surface should be rendered as sky.</p>
|
||||
|
||||
<h2 id="slick">surfaceparm slick</h2>
|
||||
<p>This surfaceparm included in a texture should give it zero friction and air type of acceleration, while standing on it. This keyword is found in "common/slick" but you may want to specify this on certain shaders (ice, for example).</p>
|
||||
|
||||
<h2 id="slime">surfaceparm slime</h2>
|
||||
<p>Assigns to the texture the game properties for slime. This affects both the surface and the content of a brush.</p>
|
||||
|
||||
<h2 id="structural">surfaceparm structural</h2>
|
||||
<p>This surface attribute causes a brush to be seen by the Q3Map2 process as a possible break-point in a BSP tree. It is used as a part of the shader for the "hint" texture. Generally speaking, any opaque texture not marked as "detail" is, by default, structural, so you shouldn't need to specify this.</p>
|
||||
|
||||
<h2 id="trans">surfaceparm trans</h2>
|
||||
<p>Tells Q3Map2 that pre-computed visibility should not be blocked by this surface. Generally, any shaders that have blendfunc's should be marked as surfaceparm trans.</p>
|
||||
|
||||
<h2 id="water">surfaceparm water</h2>
|
||||
<p>Assigns to the texture the game properties for water. This affects both the surface and the content of a brush.</p>
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
BIN
docs/shaderManual/q3map2.gif
Normal file
|
After Width: | Height: | Size: 318 B |
BIN
docs/shaderManual/qer_alphafunc.jpg
Normal file
|
After Width: | Height: | Size: 53 KiB |
BIN
docs/shaderManual/ql_32.png
Normal file
|
After Width: | Height: | Size: 2.3 KiB |
104
docs/shaderManual/quake-editor-radiant-directives.html
Normal file
|
|
@ -0,0 +1,104 @@
|
|||
<?xml version="1.1" encoding="iso-8859-1"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
|
||||
<head>
|
||||
<title>Q3Map2 Shader Manual</title>
|
||||
<meta name="keywords" content="id software, quake, radiant, qeradiant, gtkradiant, q3map, q3map2, shader, manual, ydnar, obsidian" />
|
||||
<meta name="description" content="Q3Map2 Shader Manual" />
|
||||
<meta name="copyright" content="Obsidian © 2010" />
|
||||
<link rel="stylesheet" href="default.css" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/_css/default.css" type="text/css" media="all" title="Default styles" />
|
||||
</head>
|
||||
<body id="dir_qer">
|
||||
|
||||
<div id="nav">
|
||||
<div id="navbutton">
|
||||
<ul>
|
||||
<div id="navtop"></div>
|
||||
<li><a href="index.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/index.html">Q3Map2 Shader Manual</a></li>
|
||||
<li><a href="contents.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/contents.html">Full Contents</a></li>
|
||||
<li>Introduction
|
||||
<ul>
|
||||
<li><a href="preface.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/preface.html">Preface</a></li>
|
||||
<li><a href="shader-concepts.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/shader-concepts.html">Shader Concepts</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Directives
|
||||
<ul>
|
||||
<li><a href="general-directives.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/general-directives.html">General Directives</a></li>
|
||||
<li><a href="q3map-global-directives.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-global-directives.html">Q3Map Global Directives</a></li>
|
||||
<li><a href="q3map-surface-parameter-directives.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-surface-parameter-directives.html">Q3Map Surface Parameter Directives</a></li>
|
||||
<li><a href="quake-editor-radiant-directives.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/quake-editor-radiant-directives.html">Quake Editor Radiant Directives</a></li>
|
||||
<li><a href="stage-directives.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/stage-directives.html">Stage Directives</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Articles
|
||||
<ul>
|
||||
<li><a href="texture-creation.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/texture-creation.html">Texture Creation</a></li>
|
||||
<li><a href="alpha-channels.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/alpha-channels.html">Alpha Channels</a></li>
|
||||
<li><a href="light-emitting-shaders.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/light-emitting-shaders.html">Light Emitting Shaders</a></li>
|
||||
<li><a href="lightstyles.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/lightstyles.html">Lightstyles</a></li>
|
||||
<li><a href="cel-shading.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/cel-shading.html">Cel Shading</a></li>
|
||||
<li><a href="decal-tricks.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/decal-tricks.html">Decal Tricks</a></li>
|
||||
<li><a href="foghull.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/foghull.html">Foghull</a></li>
|
||||
<li><a href="fur.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/fur.html">Fur</a></li>
|
||||
<li><a href="terrain-and-alphamod-blends.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/terrain-and-alphamod-blends.html">Terrain and alphaMod Blends</a></li>
|
||||
<li><a href="triggerable-shader-entities.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/triggerable-shader-entities.html">Triggerable Shader Entities</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<div id="navlow"></div>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h1>Radiant Editor Directives</h1>
|
||||
<p>These directives only affect the texture when it is seen in the Radiant editor. They have no effect on the surface in-game. They should be grouped with the surface parameters but ahead of them in sequence.</p>
|
||||
|
||||
<h2 id="editorImage">qer_editorImage textureName</h2>
|
||||
<p>This directive creates a shader name in memory, but in the editor, it displays the TGA art image specified in qer_editorImage (in the shader below this is, textures/eerie/lavahell.tga).</p>
|
||||
<p>The editor maps a texture using the size attributes of the TGA file used for the editor image. When that editor image represents a shader, any texture used in any of the shader stages will be scaled up or down to the dimensions of the editor image. If a 128x128 pixel image is used to represent the shader in the editor, then a 256x256 image used in a later stage will be shrunk to fit. A 64x64 image would be stretched to fit. Be sure to check this on bouncy, acceleration, and power-up pads placed on surfaces other than 256 x 256. Use tcMod scale to change the size of the stretched texture. Remember that tcMod scale 0.5 0.5 will double your image, while tcMod scale 2 2 will halve it.</p>
|
||||
<pre>
|
||||
textures/liquids/lavahell2 //path and name of new texture
|
||||
{
|
||||
qer_editorImage textures/eerie/lavahell.tga //based on this
|
||||
qer_nocarve //cannot be cut by CSG subtract
|
||||
surfaceparm noimpact //projectiles do not hit it
|
||||
surfaceparm lava //has the game properties of lava
|
||||
surfaceparm nolightmap //environment lighting does not affect
|
||||
q3map_surfacelight 3000 //light is emitted
|
||||
tessSize 256 //relatively large triangles
|
||||
cull disable //no sides are removed
|
||||
deformVertexes wave 100 sin 5 5 .5 0.02
|
||||
fogparms 0.8519142 0.309723 0.0 128 128
|
||||
{
|
||||
maptextures/eerie/lavahell.tga //base texture artwork
|
||||
tcMod turb .25 0.2 1 0.02 //texture is subjected to turbulence
|
||||
tcMod scroll 0.1 0.1 //the turbulence is scrolled
|
||||
}
|
||||
}
|
||||
</pre>
|
||||
<blockquote>
|
||||
<h4>Design Notes:</h4>
|
||||
<p>The base_light and gothic_light shaders contain numerous uses of this. It can be very useful for making different light styles (mostly to change the light brightness) without having to create a new piece of TGA art for each new shader.</p>
|
||||
</blockquote>
|
||||
|
||||
<h2 id="noCarve">qer_noCarve</h2>
|
||||
<p>A brush marked with this instruction will not be affected by CSG subtract functions. It is especially useful for water and fog textures.</p>
|
||||
|
||||
<h2 id="trans">qer_trans N.N</h2>
|
||||
<p>This directive defines the percentage of transparency that a brush will have when seen in the editor (no effect on game rendering at all). It can have a positive value between 0 and 1. The higher the value, the less transparent the texture. Example: qer_trans 0.2 means the brush is 20% opaque and nearly invisible.</p>
|
||||
<blockquote>
|
||||
<h4>Design Notes:</h4>
|
||||
<p>On GtkRadiant 1.4 and earlier, if the shader uses qer_trans and a qer_editorImage with an alpha channel, the transparent areas of the editorImage will be 100% transparent. To keep the solid areas of the editorImage opaque, use a near 1 value for qer_trans (eg. 0.9999). This is useful for grates, windows, fences, etc. If using GtkRadiant 1.5 or later, use qer_alphaFunc for editorImage masking instead.</p>
|
||||
</blockquote>
|
||||
|
||||
<h2 id="alphaFunc">qer_alphaFunc func N.N</h2>
|
||||
<p>This directive is only supported by GtkRadiant 1.5 based editors. This is used when you have an alpha channel in the editorImage that you want to appear as an alpha mask in the editor. qer_alphaFunc by itself does not get filtered with qer_trans. This is useful for grates, windows, fences, etc.</p>
|
||||
|
||||
<p>Supported functions are: equal, greater, less, gequal, lequal.<br>Values: positive between 0 and 1.</p>
|
||||
|
||||
<img src="qer_alphafunc.jpg" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/_images/qer_alphafunc.jpg" alt="Grates using qer_alphaFunc" class="center" />
|
||||
|
||||
</body>
|
||||
</html>
|
||||
190
docs/shaderManual/shader-concepts.html
Normal file
|
|
@ -0,0 +1,190 @@
|
|||
<?xml version="1.1" encoding="iso-8859-1"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
|
||||
<head>
|
||||
<title>Q3Map2 Shader Manual</title>
|
||||
<meta name="directives" content="id software, quake, radiant, qeradiant, gtkradiant, q3map, q3map2, shader, manual, ydnar, obsidian" />
|
||||
<meta name="description" content="Q3Map2 Shader Manual" />
|
||||
<meta name="copyright" content="Obsidian © 2010" />
|
||||
<link rel="stylesheet" href="default.css" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/_css/default.css" type="text/css" media="all" title="Default styles" />
|
||||
</head>
|
||||
<body id="intro_shader_concepts">
|
||||
|
||||
<div id="nav">
|
||||
<div id="navbutton">
|
||||
<ul>
|
||||
<div id="navtop"></div>
|
||||
<li><a href="index.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/index.html">Q3Map2 Shader Manual</a></li>
|
||||
<li><a href="contents.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/contents.html">Full Contents</a></li>
|
||||
<li>Introduction
|
||||
<ul>
|
||||
<li><a href="preface.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/preface.html">Preface</a></li>
|
||||
<li><a href="shader-concepts.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/shader-concepts.html">Shader Concepts</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Directives
|
||||
<ul>
|
||||
<li><a href="general-directives.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/general-directives.html">General Directives</a></li>
|
||||
<li><a href="q3map-global-directives.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-global-directives.html">Q3Map Global Directives</a></li>
|
||||
<li><a href="q3map-surface-parameter-directives.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-surface-parameter-directives.html">Q3Map Surface Parameter Directives</a></li>
|
||||
<li><a href="quake-editor-radiant-directives.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/quake-editor-radiant-directives.html">Quake Editor Radiant Directives</a></li>
|
||||
<li><a href="stage-directives.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/stage-directives.html">Stage Directives</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Articles
|
||||
<ul>
|
||||
<li><a href="texture-creation.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/texture-creation.html">Texture Creation</a></li>
|
||||
<li><a href="alpha-channels.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/alpha-channels.html">Alpha Channels</a></li>
|
||||
<li><a href="light-emitting-shaders.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/light-emitting-shaders.html">Light Emitting Shaders</a></li>
|
||||
<li><a href="lightstyles.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/lightstyles.html">Lightstyles</a></li>
|
||||
<li><a href="cel-shading.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/cel-shading.html">Cel Shading</a></li>
|
||||
<li><a href="decal-tricks.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/decal-tricks.html">Decal Tricks</a></li>
|
||||
<li><a href="foghull.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/foghull.html">Foghull</a></li>
|
||||
<li><a href="fur.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/fur.html">Fur</a></li>
|
||||
<li><a href="terrain-and-alphamod-blends.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/terrain-and-alphamod-blends.html">Terrain and alphaMod Blends</a></li>
|
||||
<li><a href="triggerable-shader-entities.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/triggerable-shader-entities.html">Triggerable Shader Entities</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<div id="navlow"></div>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h1>Shader Concepts</h1>
|
||||
<p>The graphic engine for <em>id Tech 3</em> has taken a step forward by putting much more direct control over the surface qualities of textures into the hands of designers and artists. In writing this manual, we have tried to define the concepts and tools that are used to modify textures in a way that, it is hoped, will be graspable by users who already have basic knowledge of computer graphics but are not necessarily computer programmers. It is not a tutorial, nor is it intended to be one.</p>
|
||||
<p>The Manual for the Q3Radiant editor program contains a section called <em>Creating New Assets</em> that has the necessary information for setting up the files to create your own custom <em>id Tech 3</em> shaders. You should follow a similar convention when creating your custom shaders. It is reproduced here for your convenience:</p>
|
||||
<blockquote>
|
||||
<h4>Creating New Assets</h4>
|
||||
<p>If you are familiar with the required tools, creating new assets for use in Quake III Arena is not particularly difficult. As a rule, you should create new directories for each map with names different from the names used by id. If you are making a map that will be called "H4x0r_D00M", every directory containing new assets for that map should be titled H4x0r_D00M. This is to try and avoid asset directories overwriting each other as the editor and the game load in assets. </p>
|
||||
</blockquote>
|
||||
<p>It is recommended that you study the scripts in this document and in the individual game shader scripts. Pay careful attention to syntax and punctuation. This is where you are most likely to make mistakes.</p>
|
||||
|
||||
<h2 id="whatisashader">What is a Shader?</h2>
|
||||
<p>Shaders are short text scripts that define the properties of a surface as it appears and functions in a game world (or compatible editing tool). By convention, the documents that contain these scripts usually have the same name as the texture set which contains the textures being modified (e.g. base, hell, castle, etc.). Several specific script documents have also been created to handle special cases, like liquids, sky and special effects. For Quake III Arena, shader scripts are located in "baseq3/scripts" or in the compressed PK3 file "baseq3/pak0.pk3".</p>
|
||||
|
||||
<p>A Quake III Arena shader file consists of a series of surface attribute and rendering instructions formatted within braces ("{" and "}"). Below you can see a simple example of syntax and format for a single process, including the Q3Map2 directives and "Surface Parameters", which follow the first bracket and a single bracketed "stage":</p>
|
||||
<pre>
|
||||
textures/liquids/lava-example //Shader name
|
||||
{
|
||||
deformVertexes wave sin 0 3 0 0.1 //General directive
|
||||
q3map_tessSize 64 //Q3Map2 directive
|
||||
surfaceparm lava //Surface parameter directive
|
||||
qer_editorimage textures/common/lava.tga //Editor directive
|
||||
{
|
||||
map textures/common/lava.tga //Stage directive
|
||||
}
|
||||
}
|
||||
</pre>
|
||||
<p>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.</p>
|
||||
|
||||
<h2 id="shadername&fileconventions">Shader Name & File Conventions</h2>
|
||||
<p>The first line is the shader name. It is used by the map editor, compiler, game engine, and models to reference the script and art files associated with the shader. Shader names can be up to 63 characters long. The names are often a mirror of a pathname to the texture image without the file extension (.tga or .jpg) or base dir (/quake3/baseq3 in our case), but they do not need to be.</p>
|
||||
<p>Shaders that are only going to be referenced by the game code, not modeling tools, often are just a single word, like "projectionShadow" or "viewBlood".</p>
|
||||
<p>Shaders that are used on character or other polygon mesh models need to mirror the art files, which allows the modelers to build with normal textures, then have the special effects show up when the model is loaded into the game.</p>
|
||||
<p>Shaders that are placed on surfaces in the map editor commonly mirror an image file, but the "qer_editorimage" shader parameter can force the editor to use an arbitrary image for display.</p>
|
||||
<p>Shader path names have a case sensitivity issue - on Windows, they aren't case sensitive, but on Unix they are. Try to always use lowercase for filenames, and always use forward slashes "/" for directory separators.</p>
|
||||
<p>Following the shader name, is an opening bracket "{" designating the beginning of the shader contents, and a closing bracket "}" at the end of the shader. Notice that the contents of the above example shader are indented for better legibility.</p>
|
||||
|
||||
<h2 id="keyconcepts">Key Concepts</h2>
|
||||
<p>Ideally, a designer or artist who is manipulating textures with shader files has a basic understanding of wave forms and knows about mixing colored light (high school physics sort of stuff). If not, there are some concepts you need to have a grasp on to make shaders work for you.</p>
|
||||
|
||||
<h3>Surface Effects vs. Content Effects vs. Deformation Effects</h3>
|
||||
<p>Shaders not only modify the visible aspect of textures on a geometry brush, curve, patch or mesh model, but they can also have an effect on both the content, "shape," and apparent movement of those things. A surface effect does nothing to modify the shape or content of the brush. Surface effects include glows, transparencies and rgb (red, green, blue) value changes. Content shaders affect the way the brush operates in the game world. Examples include water, fog, nonsolid, and structural. Deformation effects change the actual shape of the affected brush or curve, and may make it appear to move.</p>
|
||||
|
||||
<h3>Power Has a Price</h3>
|
||||
<p>The shader script gives the designer, artist and programmer a great deal of easily accessible power over the appearance of and potential special effects that may be applied to surfaces in the game world. But it is power that comes with a price tag attached, and the cost is measured in performance speed. Each shader phase that affects the appearance of a texture causes the Quake III engine to make another processing pass and redraw the world. Think of it as if you were adding all the shader-affected triangles to the total r_speed count for each stage in the shader script. A shader-manipulated texture that is seen through another shader-manipulated texture (e.g. a light in fog) has the effect of adding the total number of passes together for the affected triangles. A light that required two passes seen through a fog that requires one pass will be treated as having to redraw that part of the world three times.</p>
|
||||
|
||||
<h3 id="rgbcolor">RGB Color</h3>
|
||||
<p>RGB means "Red, Green, Blue". Mixing red, green and blue light in differing intensities creates the colors in computers and television monitors. This is called additive color (as opposed to the mixing of pigments in paint or colored ink in the printing process, which is subtractive color). In Quake III Arena and most higher-end computer art programs (and the color selector in Windows), the intensities of the individual Red, Green and Blue components are expressed as number values. When mixed together on a screen, number values of equal intensity in each component color create a completely neutral (gray) color. The lower the number value (towards 0), the darker the shade. The higher the value, the lighter the shade or the more saturated the color until it reaches a maximum value of 255 (in the art programs). All colors possible on the computer can be expressed as a formula of three numbers. The value for complete black is 0 0 0. The value for complete white is 255 255 255. However, the Quake III Arena graphics engine requires that the color range be "normalized" into a range between 0.0 and 1.0.</p>
|
||||
|
||||
<h3 id="normalization">Normalization: a Scale of 0 to 1</h3>
|
||||
<p>The mathematics in Quake III Arena use a scale of 0.0 to 1.0 instead of 0 to 255. Most computer art programs that can express RGB values as numbers use the 0 to 255 scale. To convert numbers, divide each of the art program's values for the component colors by 255. The resulting three values are your Quake III Arena formula for that color component. The same holds true for texture coordinates.</p>
|
||||
|
||||
<h3 id="texturesizes">Texture Sizes</h3>
|
||||
<p>TGA texture files are measured in pixels (picture elements). Textures are measured in powers of 2, with 16 x16 pixels being the smallest (typically) texture in use. Most will be larger. Textures need not be square, so long as both dimensions are powers of 2. Examples include: 32x256, 16x32, 128x16.</p>
|
||||
|
||||
<h3 id="colormath">Color Math</h3>
|
||||
<p>In Quake III Arena, colors are changed by mathematical equations worked on the textures by way of the scripts or "programlets" in the shader file. An equation that adds to, or multiplies the number values in a texture causes it to become darker. Equations that subtract from or modulate number values in a texture cause it to become lighter. Either equation can change the hue and saturation of a color.</p>
|
||||
|
||||
<h3 id="measurements">Measurements</h3>
|
||||
<p>The measurements used in the shaders are in either game units, color units, or texture units.</p>
|
||||
<dl>
|
||||
<dt>Game unit</dt><dd>A game unit is used by deformations to specify sizes relative to the world. Game units are the same scale we have had since way back in the Wolfenstein days - 8 units equals one foot. The default texture scale used by the Radiant map editor results in two texels for each game unit, but that can be freely changed.</dd>
|
||||
<dt>Color units</dt><dd>Colors scale the values generated by the texture units to produce lighting effects. A value of 0.0 will be completely black, and a value of 1.0 will leave the texture unchanged. Colors are sometimes specified with a single value to be used across all red, green, and blue channels, or sometimes as separate values for each channel.</dd>
|
||||
<dt>Texture units</dt><dd>This is the normalized (see above) dimensions of the original texture image (or a previously modified texture at a given stage in the shader pipeline). A full texture, regardless of its original size in texels, has a normalized measurement of 1.0 x 1.0. For normal repeating textures, it is possible to have value greater than 1.0 or less than 0.0, resulting in repeating of the texture. The coordinates are usually assigned by the level editor or modeling tools, but you still need to be aware of this for scrolling or turbulent movement of the texture at runtime.</dd>
|
||||
</dl>
|
||||
|
||||
<h3 id="waveformfunctions">Waveform Functions</h3>
|
||||
<p>Many of the shader functions use waveforms to modulate measurements over time. Where appropriate, additional information is provided with wave modulated directive functions to describe the effect of a particular waveform on that process. Currently there are five waveforms in use in Q3A shaders:</p>
|
||||
<dl>
|
||||
<dt>Sin</dt><dd>Sin stands for sine wave, a regular smoothly flowing wave function ranging from -1 to 1.</dd>
|
||||
<dt>Triangle</dt><dd>Triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make choppy looking wave forms.</dd>
|
||||
<dt>Square</dt><dd>A square wave simply switches from -1 to 1 with no in-between.</dd>
|
||||
<dt>Sawtooth</dt><dd>In the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0.</dd>
|
||||
<dt>Inversesawtooth</dt><dd>This is the reverse of the sawtooth... instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.</dd>
|
||||
<dt>Noise</dt><dd>Available for some functions only (rgbGen wave, but not alphaGen wave), adds a randomly changing value. The frequency value is (probably) hard-coded so changing it (probably) doesn't affect the speed of the flickering.</dd>
|
||||
</dl>
|
||||
<p>Waveforms all have the following properties:</p>
|
||||
<dl>
|
||||
<dt>base</dt><dd>Where the wave form begins. Amplitude is measured from this base value.</dd>
|
||||
<dt>amplitude</dt><dd>This is the height of the wave created, measured from the base. You will probably need to test and tweak this value to get it correct for each new shader stage. The greater the amplitude, the higher the wave peaks and the deeper the valleys.</dd>
|
||||
<dt>phase</dt><dd>This is a normalized value between 0.0 and 1.0. Changing phase to a non-zero value affects the point on the wave at which the wave form initially begins to be plotted. Example: In Sin or Triangle wave, a phase of 0.25 means it begins one fourth (25%) of the way along the curve, or more simply put, it begins at the peak of the wave. A phaseof 0.5 would begin at the point the wave re-crosses the base line. A phase of 0.75 would be at the lowest point of the valley. If only one wave form is being used in a shader, a phase shift will probably not be noticed and phase should have a value of zero (0). However, including two or more stages of the same process in a single shader, but with the phases shifted can be used to create interesting visual effects. Example: using rgbGen in two stages with different colors and a 0.5 difference in phase would cause the manipulated texture to modulate between two distinct colors. Phase changes can also be used when you have two uses of the same effect near each other, and you don't want them to be synchronized. You would write a separate shader for each, changing only the phase value.</dd>
|
||||
<dt>freq</dt><dd>Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of 1 would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.</dd>
|
||||
</dl>
|
||||
|
||||
<h2 id="specialcasesyntax">Special Case Syntax</h2>
|
||||
<p>There are a couple of special syntax types to be aware of that may be useful to shader artists.</p>
|
||||
|
||||
<h3>Documenting With Comments</h3>
|
||||
<p>It is often useful to document parts of shaders, especially for testing purposes or when working with a development team of other designers. Comments added to shaders are ignored completely, making it useful for adding notes, or for temporarily removing directives for testing.</p>
|
||||
<p>
|
||||
Shaders use the same double forward slashes "//" convention common with many programming languages for commenting. All text after the "//" on the same line are ignored from the shader. Block comments such as "/* , */" from other programming languages do not work. See various shaders for examples.</p>
|
||||
|
||||
<h3>:q3map Suffix</h3>
|
||||
<p>The :q3map suffix can be added to the end of the shader name of "compile-time" shaders. This means that shaders with names marked with :q3map will be used by the compiler only and will be ignored by the game engine. This is especially useful if you want to add Q3Map2-relevant shader directives to basic lightmapped textures. This allows Quake 3 to generate the stages implicitly while Q3Map2 processes the Q3Map2-relevant sections of the shader. Consider the following shaders:</p>
|
||||
<pre>
|
||||
textures/q3map2_sm/floor
|
||||
{
|
||||
surfaceparm metalsteps
|
||||
{
|
||||
map $lightmap
|
||||
rgbGen identity
|
||||
}
|
||||
{
|
||||
map textures/q3map2_sm/floor.tga
|
||||
blendFunc GL_DST_COLOR GL_ZERO
|
||||
}
|
||||
}
|
||||
</pre>
|
||||
<p>Normally, we wouldn't need a shader for this texture to be displayed properly in game since the lightmap and texture stages are generated implicitly by Quake 3. The only reason why this shader exists is because we want Q3Map2 to process this surface as having metalsteps when the player walks on it. As a result, we end up writing out the entire shader.</p>
|
||||
<p>To save ourselves from needless work, we can mark this shader as being compiler-only and have Quake 3 generate the lightmap and texture stages for us as it usually does by default:</p>
|
||||
<pre>
|
||||
textures/q3map2_sm/floor:q3map
|
||||
{
|
||||
surfaceparm metalsteps
|
||||
}
|
||||
</pre>
|
||||
|
||||
<h2 id="directivetypes">Directive Types</h2>
|
||||
<p>Only the shader name is case sensitive (use all lowercase). Shader directives are not, but by convention, you should use mixedCase (ie. q3map_alphaMod). Some of the shader directives are order dependant, so it's good practice to keep all directive of a similar type grouped together in the following order, from top-down:</p>
|
||||
|
||||
<h3>General Directives</h3>
|
||||
<p>A shader may contain general directives, which affects the shader's appearance globally (affects the entire shader), and changes the physical attributes of the surface that uses the shader. These attributes can affect the player. These parameters are executed at runtime, that is, in order to see the changes one does not need to re-compile the map.</p>
|
||||
|
||||
<h3>Q3Map Directives</h3>
|
||||
<p>The general directives may be followed by Q3Map directives. These directives are used by the compiler to change the physical nature of the shader's surface and are also global.</p>
|
||||
|
||||
<h3>Q3Map Surface Parameter Directives</h3>
|
||||
<p>These are actually part of the Q3Map directives that are flags telling the compiler about the physical nature of the shader's surface. These are also global.</p>
|
||||
|
||||
<h3>Radiant Editor Directives</h3>
|
||||
<p>Radiant editor directives change the appearance of the shader in the map editor only. It has no effect on the shader in game.</p>
|
||||
|
||||
<h3>Stage Specific Shader Directives</h3>
|
||||
<p>The shader may contain one or more "stages". Each stage consists of an opening and closing bracket along with the contents of the stage (indented). The stage will contain a texture map specification which specifies the source image, and various other stages specific shader directives that modifies the appearance of the source image. Stage specific directives are processed by the renderer. They are appearance changes only and have no effect on game play or game mechanics. Changes to any of these attributes will take effect as soon as the game goes to another level or vid_restarts (type command "/vid_restart" in the game console).</p>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
BIN
docs/shaderManual/sky01.jpg
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
docs/shaderManual/sky02.jpg
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
docs/shaderManual/sky03.jpg
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
docs/shaderManual/sky04.jpg
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
docs/shaderManual/sky05.jpg
Normal file
|
After Width: | Height: | Size: 23 KiB |
454
docs/shaderManual/stage-directives.html
Normal file
|
|
@ -0,0 +1,454 @@
|
|||
<?xml version="1.1" encoding="iso-8859-1"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
|
||||
<head>
|
||||
<title>Q3Map2 Shader Manual</title>
|
||||
<meta name="keywords" content="id software, quake, radiant, qeradiant, gtkradiant, q3map, q3map2, shader, manual, ydnar, obsidian" />
|
||||
<meta name="description" content="Q3Map2 Shader Manual" />
|
||||
<meta name="copyright" content="Obsidian © 2010" />
|
||||
<link rel="stylesheet" href="default.css" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/_css/default.css" type="text/css" media="all" title="Default styles" />
|
||||
</head>
|
||||
<body id="dir_stage">
|
||||
|
||||
<div id="nav">
|
||||
<div id="navbutton">
|
||||
<ul>
|
||||
<div id="navtop"></div>
|
||||
<li><a href="index.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/index.html">Q3Map2 Shader Manual</a></li>
|
||||
<li><a href="contents.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/contents.html">Full Contents</a></li>
|
||||
<li>Introduction
|
||||
<ul>
|
||||
<li><a href="preface.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/preface.html">Preface</a></li>
|
||||
<li><a href="shader-concepts.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/shader-concepts.html">Shader Concepts</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Directives
|
||||
<ul>
|
||||
<li><a href="general-directives.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/general-directives.html">General Directives</a></li>
|
||||
<li><a href="q3map-global-directives.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-global-directives.html">Q3Map Global Directives</a></li>
|
||||
<li><a href="q3map-surface-parameter-directives.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-surface-parameter-directives.html">Q3Map Surface Parameter Directives</a></li>
|
||||
<li><a href="quake-editor-radiant-directives.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/quake-editor-radiant-directives.html">Quake Editor Radiant Directives</a></li>
|
||||
<li><a href="stage-directives.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/stage-directives.html">Stage Directives</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Articles
|
||||
<ul>
|
||||
<li><a href="texture-creation.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/texture-creation.html">Texture Creation</a></li>
|
||||
<li><a href="alpha-channels.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/alpha-channels.html">Alpha Channels</a></li>
|
||||
<li><a href="light-emitting-shaders.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/light-emitting-shaders.html">Light Emitting Shaders</a></li>
|
||||
<li><a href="lightstyles.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/lightstyles.html">Lightstyles</a></li>
|
||||
<li><a href="cel-shading.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/cel-shading.html">Cel Shading</a></li>
|
||||
<li><a href="decal-tricks.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/decal-tricks.html">Decal Tricks</a></li>
|
||||
<li><a href="foghull.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/foghull.html">Foghull</a></li>
|
||||
<li><a href="fur.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/fur.html">Fur</a></li>
|
||||
<li><a href="terrain-and-alphamod-blends.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/terrain-and-alphamod-blends.html">Terrain and alphaMod Blends</a></li>
|
||||
<li><a href="triggerable-shader-entities.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/triggerable-shader-entities.html">Triggerable Shader Entities</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<div id="navlow"></div>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h1>Stage Directives</h1>
|
||||
<p>Stage specifications only affect rendering. Changing any directives or values within a stage will usually take effect as soon as a vid_restart is executed. Q3Map2 ignores stage directives entirely.</p>
|
||||
<p>A stage can specify a texture map, a color function, an alpha function, a texture coordinate function, a blend function, and a few other rasterization options.</p>
|
||||
|
||||
<h2 id="map">Texture Map Specification</h2>
|
||||
|
||||
<h3>map <em>texturename</em></h3>
|
||||
<p>Specifies the source texture map (a 24 or 32-bit TGA or JPG file) used for this stage. The texture may or may not contain alpha channel information. The special keywords $lightmap and $whiteimage may be substituted in lieu of an actual texture map name. In those cases, the texture named in the first line of the shader becomes the texture that supplies the light mapping data for the process. The texture name should always end with the ".tga" suffix regardless of whether the source texture map is actually a .tga file or .jpg.</p>
|
||||
|
||||
<h3>map <em>$lightmap</em></h3>
|
||||
<p>This is the overall lightmap for the game world. It is calculated during the Q3Map2 process. It is the initial color data found in the framebuffer. Note: due to the use of overbright bits in light calculation, the keyword rgbGen identity must accompany all $lightmap instructions.</p>
|
||||
|
||||
<h3>map <em>$whiteimage</em></h3>
|
||||
<p>This is used for specular lighting on MD3 models. This is a white image generated internally by the game. This image can be used in lieu of $lightmap or an actual texture map if, for example, you wish for the vertex colors to come through unaltered.</p>
|
||||
|
||||
<h3>clampMap <em>texturename</em></h3>
|
||||
<!-- obsidian: clampMap may have been once named clampTexCoords. Changed all instances of clampTexCoords (2nd paragraph) to clampMap -->
|
||||
<p>Dictates that this stage should clamp texture coordinates instead of wrapping them. During a stretch function, the area, which the texture must cover during a wave cycle, enlarges and decreases. Instead of repeating a texture multiple times during enlargement (or seeing only a portion of the texture during shrinking) the texture dimensions increase or contract accordingly. This is only relevant when using something like deformTexCoordParms to stretch/compress texture coordinates for a specific special effect. Remember that the Quake III Arena engine normalizes all texture coordinates (regardless of actual texture size) into a scale of 0.0 to 1.0.</p>
|
||||
<p>When using clampMap make sure the texture is properly aligned on the brush. The clampMap function keeps the image from tiling. However, the editor doesn't represent this properly and shows a tiled image. Therefore, what appears to be the correct position may be offset. This is very apparent on anything with a tcMod rotate and clampMap function.</p>
|
||||
|
||||
<p>Avoiding Distortion: When seen at a given distance (which can vary, depending on hardware and the size of the texture), the compression phase of a stretch function will cause a "cross"-like visual artifact to form on the modified texture due to the way that textures are reduced. This occurs because the texture undergoing modification lacks sufficient "empty space" around the displayed (non-black) part of the texture (see below, left)<!--(see figure 2a)-->. To compensate for this, make the non-zero portion of the texture substantially smaller (50% of maximum stretched size -- see below, right<!--figure 2b-->) than the dimensions of the texture. Then, write a scaling function (tcMod scale) into the appropriate shader phase, to enlarge the image to the desired proportion.</p>
|
||||
|
||||
<p><strong><img src="clampmap.jpg" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/_images/clampmap.jpg" alt="Figure 2a & 2b" class="center" /></strong></p>
|
||||
|
||||
<p>The shaders for the bouncy pads (in the sfx.shader file) show the stretch function in use, including the scaling of the stretched texture:</p>
|
||||
|
||||
<pre>
|
||||
textures/sfx/metalbridge06_bounce
|
||||
{
|
||||
//q3map_surfacelight 2000
|
||||
surfaceparm nodamage
|
||||
q3map_lightimage textures/sfx/jumppadsmall.tga
|
||||
q3map_surfacelight 400
|
||||
{
|
||||
map textures/sfx/metalbridge06_bounce.tga
|
||||
rgbGen identity
|
||||
}
|
||||
{
|
||||
map $lightmap
|
||||
rgbGen identity
|
||||
blendfunc gl_dst_color gl_zero
|
||||
}
|
||||
{
|
||||
map textures/sfx/bouncepad01b_layer1.tga
|
||||
blendfunc gl_one gl_one
|
||||
rgbGen wave sin .5 .5 0 1.5
|
||||
}
|
||||
{
|
||||
clampmap textures/sfx/jumppadsmall.tga
|
||||
blendfunc gl_one gl_one
|
||||
tcMod stretch sin 1.2 .8 0 1.5
|
||||
rgbGen wave square .5 .5 .25 1.5
|
||||
}
|
||||
// END
|
||||
}
|
||||
</pre>
|
||||
|
||||
<h3>animMap <em>frequency texture1... texture8</em></h3>
|
||||
<p>The surfaces in the game can be animated by displaying a sequence of 1 to 8 frames (separate texture maps). These animations are affected by other keyword effects in the same and later shader stages.</p>
|
||||
<dl>
|
||||
<dt>frequency</dt><dd>The number of times that the animation cycle will repeat within a one second time period. The larger the value, the more repeats within a second. Animations that should last for more than a second need to be expressed as decimal values.</dd>
|
||||
<dt>texture1... texture8</dt><dd>the texture path/texture name for each animation frame must be explicitly listed. Up to eight frames (eight separate .tga files) can be used to make an animated sequence. Each frame is displayed for an equal subdivision of the frequency value.</dd>
|
||||
</dl>
|
||||
<blockquote>
|
||||
<h4>Example:</h4>
|
||||
<p>animMap 0.25 textures/sfx/b_flame1.tga textures/sfx/b_flame2.tga textures/sfx/b_flame3.tga textures/sfx/b_flame4.tga would be a 4 frame animated sequence, calling each frame in sequence over a cycle length of 4 seconds. Each frame would be displayed for 1 second before the next one is displayed. The cycle repeats after the last frame in sequence shown.</p>
|
||||
</blockquote>
|
||||
<pre>
|
||||
textures/sfx/flameanim_blue
|
||||
{
|
||||
|
||||
// ***********************************************
|
||||
// * Blue Flame *
|
||||
// * July 20, 1999 Surface Light 1800 *
|
||||
// * Please Comment Changes *
|
||||
// ***********************************************
|
||||
qer_editorimage textures/sfx/b_flame7.tga
|
||||
q3map_lightimage textures/sfx/b_flame7.tga
|
||||
surfaceparm trans
|
||||
surfaceparm nomarks
|
||||
surfaceparm nolightmap
|
||||
cull none
|
||||
q3map_surfacelight 1800
|
||||
// texture changed to blue flame.... PAJ
|
||||
{
|
||||
animMap 10 textures/sfx/b_flame1.tga textures/sfx/b_flame2.tga
|
||||
textures/sfx/b_flame3.tga textures/sfx/b_flame4.tga
|
||||
textures/sfx/b_flame5.tga textures/sfx/b_flame6.tga
|
||||
textures/sfx/b_flame7.tga textures/sfx/b_flame8.tga
|
||||
blendFunc GL_ONE GL_ONE
|
||||
rgbGen wave inverseSawtooth 0 1 0 10
|
||||
}
|
||||
{
|
||||
animMap 10 textures/sfx/b_flame2.tga textures/sfx/b_flame3.tga
|
||||
textures/sfx/b_flame4.tga textures/sfx/b_flame5.tga
|
||||
textures/sfx/b_flame6.tga textures/sfx/b_flame7.tga
|
||||
textures/sfx/b_flame8.tga textures/sfx/b_flame1.tga
|
||||
blendFunc GL_ONE GL_ONE
|
||||
rgbGen wave sawtooth 0 1 0 10
|
||||
}
|
||||
{
|
||||
map textures/sfx/b_flameball.tga
|
||||
blendFunc GL_ONE GL_ONE
|
||||
rgbGen wave sin .6 .2 0 .6
|
||||
}
|
||||
}
|
||||
</pre>
|
||||
<blockquote>
|
||||
<h4>Design Notes:</h4>
|
||||
<p>To make a texture image appear for an unequal (longer) amount of time (compared to other frames), repeat that frame more than once in the sequence.</p>
|
||||
</blockquote>
|
||||
|
||||
<h3>videoMap <em>videoname</em></h3>
|
||||
<p>Surfaces marked with a shader containing this directive in one of its stages will display an animated video playing in a continuous loop. The video clip must be in ROQ format and playing at 30 frames per second. The ROQ file is stored in the "video" directory within the main mod directory. A third-party program is required to convert other video formats to the ROQ format for use within Quake III engine games.</p>
|
||||
<pre>
|
||||
textures/obsidian_video/intro
|
||||
{
|
||||
qer_editorImage textures/obsidian_video/qer_intro.tga
|
||||
surfaceparm nolightmap
|
||||
{
|
||||
videoMap obsidian_intro.roq
|
||||
rgbGen identity
|
||||
}
|
||||
}
|
||||
</pre>
|
||||
|
||||
<blockquote>
|
||||
<h4>Historical Information:</h4>
|
||||
<p>The ROQ format is a proprietary video format developed by Graeme Devine originally used for "The 7th Guest" for the purpose of being able to decompress quickly while maintaining high image quality. It was later adopted by Id Software for use in Quake III Arena.</p>
|
||||
</blockquote>
|
||||
|
||||
<h2 id="blendFunc">blendFunc <em>func</em></h2>
|
||||
<p>Blend functions are the keyword commands that tell the Quake III Arena graphic engine's renderer how graphic layers are to be mixed together.</p>
|
||||
|
||||
<h3>Simplified Blend Functions</h3>
|
||||
<p>The most common blend functions are set up here as simple commands, and should be used unless you really know what you are doing.</p>
|
||||
<dl>
|
||||
<dt>add</dt><dd>Shorthand command for blendFunc gl_one gl_one. Effects like fire and energy are additive.</dd>
|
||||
<dt>filter</dt><dd>Shorthand command that can be substituted for either blendFunc gl_dst_color gl_zero or blendFunc gl_zero gl_src_color. A filter will always result in darker pixels than what is behind it, but it can also remove color selectively. Lightmaps are filters.</dd>
|
||||
<dt>blend</dt><dd>Shorthand command for blendFunc gl_src_alpha gl_one_minus_src_alpha. This is conventional transparency, where part of the background is mixed with part of the texture.</dd>
|
||||
</dl>
|
||||
|
||||
<h3>Explicit Blend Functions</h3>
|
||||
<p>Getting a handle on this concept is absolutely key to understanding all shader manipulation of graphics.</p>
|
||||
|
||||
<p>blendFunc or "Blend Function" is the equation at the core of processing shader graphics. The formula reads as follows:</p>
|
||||
|
||||
<pre>[source * (srcBlend)] + [destination * (dstBlend)]</pre>
|
||||
|
||||
<p><em>Source</em> is usually the RGB color data in a texture TGA file (remember it's all numbers) modified by any rgbGen and alphaGen. In the shader, the source is generally identified by command map, followed by the name of the image.</p>
|
||||
|
||||
<p><em>Destination</em> is the color data currently existing in the frame buffer.</p>
|
||||
|
||||
<p>Rather than think of the entire texture as a whole, it maybe easier to think of the number values that correspond to a single pixel, because that is essentially what the computer is processing... one pixel of the bitmap at a time.</p>
|
||||
|
||||
<p>The process for calculating the final look of a texture in place in the game world begins with the precalculated lightmap for the area where the texture will be located. This data is in the frame buffer. That is to say, it is the initial data in the destination. In an unmanipulated texture (i.e. one without a special shader script), color information from the texture is combined with the lightmap. In a shader-modified texture, the $lightmap stage must be present for the lightmap to be included in the calculation of the final texture appearance.</p>
|
||||
|
||||
<p>Each pass or "stage" of blending is combined (in a cumulative manner) with the color data passed onto it by the previous stage. How that data combines together depends on the values chosen for the source blends and destination blends at each stage. Remember it's numbers that are being mathematically combined together that are ultimately interpreted as colors.</p>
|
||||
|
||||
<p>A general rule is that any source blend other than GL_ONE (or GL_SRC_ALPHA where the alpha channel is entirely white) will cause the source to become darker.</p>
|
||||
|
||||
<h3>Source Blend (srcBlend)</h3>
|
||||
<p>The following values are valid for the <em>source</em> blend part of the equation.</p>
|
||||
<dl>
|
||||
<dt>GL_ONE</dt><dd>This is the value 1. When multiplied by the source, the value stays the same. The value of the color information does not change.</dd>
|
||||
<dt>GL_ZERO</dt><dd>This is the value 0. When multiplied by the source, all RGB data in the source becomes zero (essentially black).</dd>
|
||||
<dt>GL_DST_COLOR</dt><dd>This is the value of color data currently in the destination (frame buffer). The value of that information depends on the information supplied by previous stages.</dd>
|
||||
<dt>GL_ONE_MINUS_DST_COLOR</dt><dd>This is nearly the same as GL_DST_COLOR except that the value for each component color is inverted by subtracting it from one. (i.e. R = 1.0 - DST.R, G = 1.0 - DST.G, B = 1.0 - DST.B, etc.)</dd>
|
||||
<dt>GL_SRC_ALPHA</dt><dd>The TGA file being used for the source data must have an alpha channel in addition to its RGB channels (for a total of four channels). The alpha channel is an 8-bit black and white only channel. An entirely white alpha channel will not darken the source.</dd>
|
||||
<dt>GL_ONE_MINUS_SRC_ALPHA</dt><dd>This is the same as GL_SRC_ALPHA except that the value in the alpha channel is inverted by subtracting it from one. (i.e. A=1.0 - SRC.A)</dd>
|
||||
</dl>
|
||||
|
||||
<h3>Destination Blend (dstBlend)</h3>
|
||||
<p>The following values are valid for the <em>destination</em> blend part of the equation.</p>
|
||||
<dl>
|
||||
<dt>GL_ONE</dt><dd>This is the value 1. When multiplied by the destination, the value stays the same the value of the color information does not change.</dd>
|
||||
<dt>GL_ZERO</dt><dd>This is the value 0. When multiplied by the destination, all RGB data in the destination becomes zero (essentially black).</dd>
|
||||
<dt>GL_SRC_COLOR</dt><dd>This is the value of color data currently in the source (which is the texture being manipulated here).</dd>
|
||||
<dt>GL_ONE_MINUS_SRC_COLOR</dt><dd>This is the value of color data currently in source, but subtracted from one (i.e. inverted).</dd>
|
||||
<dt>GL_SRC_ALPHA</dt><dd>The TGA file being used for the source data must have an alpha channel in addition to its RGB channels (four a total of four channels). The alpha channel is an 8-bit black and white only channel. An entirely white alpha channel will not darken the source.v GL_ONE_MINUS_SRC_ALPHA This is the same as GL_SRC_ALPHA except that the value in the alpha channel is inverted by subtracting it from one. (i.e. A=1.0 - SRC.A).</dd>
|
||||
</dl>
|
||||
|
||||
<h3>Doing the Math: The Final Result</h3>
|
||||
<p>The product of the source side of the equation is added to the product of the destination side of the equation. The sum is then placed into the frame buffer to become the destination information for the next stage. Ultimately, the equation creates a modified color value that is used by other functions to define what happens in the texture when it is displayed in the game world.</p>
|
||||
|
||||
<h3>Default Blend Function</h3>
|
||||
<p>If no blendFunc is specified then no blending will take place. A warning is generated if any stage after the first stage does not have a blendFunc specified.</p>
|
||||
|
||||
<h3>Technical Information/Limitations Regarding Blend Modes:</h3>
|
||||
<p>The Riva 128 graphics card supports ONLY the following blendmodes:</p>
|
||||
<ul>
|
||||
<li>GL_ONE, GL_ONE</li>
|
||||
<li>GL_DST_COLOR, GL_ZERO</li>
|
||||
<li>GL_ZERO, GL_SRC_COLOR</li>
|
||||
<li>GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA</li>
|
||||
<li>GL_ONE_MINUS_SRC_ALPHA, GL_SRC_ALPHA</li>
|
||||
</ul>
|
||||
<p>Cards running in 16 bit color cannot use any GL_DST_ALPHA blends.</p>
|
||||
|
||||
<h2 id="rgbGen">rgbGen func</h2>
|
||||
<p>There are two color sources for any given shader, the texture file and the vertex colors. Output at any given time will be equal to TEXTURE multiplied by VERTEXCOLOR. Most of the time VERTEXCOLOR will default to white (which is a normalized value of 1.0), so output will be TEXTURE (this usually lands in the Source side of the shader equation). Sometimes you do the opposite and use TEXTURE = WHITE, but this is only commonly used when doing specular lighting on entities (i.e. shaders that level designers will probably never create.</p>
|
||||
|
||||
<p>The most common reason to use rgbGen is to pulsate something. This means that the VERTEXCOLOR will oscillate between two values, and that value will be multiplied (darkening) the texture.</p>
|
||||
|
||||
<p>If no rgbGen is specified, either "identityLighting" or "identity" will be selected, depending on which blend modes are used.</p>
|
||||
|
||||
<h3>rgbGen identity</h3>
|
||||
<p>Colors are assumed to be all white (1.0, 1.0, 1.0). All filters stages (lightmaps, etc) will get this by default.</p>
|
||||
|
||||
<h3>rgbGen identityLighting</h3>
|
||||
<p>Colors will be (1.0, 1.0, 1.0) if running without overbright bits (NT, Linux, windowed modes), or (0.5, 0.5, 0.5) if running with overbright. Overbright allows a greater color range at the expense of a loss of precision. Additive and blended stages will get this by default.</p>
|
||||
|
||||
<h3>rgbGen vertex</h3>
|
||||
<p>Colors are filled in directly by the data from the map or model files. User rgbGen vertex + alphaGen const or rgbGen exactVertex to disable surfaces from being affected by alphaMod volumes.
|
||||
<blockquote>
|
||||
<h4>Design Notes:</h4>
|
||||
<p>rgbGen vertex should be used when you want the RGB values to be computed for a static model (i.e. mapobject) in the world using precomputed static lighting from Q3BSP. This would be used on things like the gargoyles, the portal frame, skulls, and other decorative models put into the Quake III Arena world.</p>
|
||||
</blockquote>
|
||||
|
||||
<h3>rgbGen oneMinusVertex</h3>
|
||||
<p>As rgbGen vertex, but inverted. This keyword would probably not be used by a level designer.</p>
|
||||
|
||||
<h3>rgbGen exactVertex</h3>
|
||||
<p>Like vertex, except exactVertex ignores overbrightbits. Generally brighter under default settings.</p>
|
||||
|
||||
<h3>rgbGen fromVertex</h3>
|
||||
<p>(Pending)</p>
|
||||
|
||||
<h3>rgbGen entity</h3>
|
||||
<p>Colors are grabbed from the entity's modulate field. This is used for things like explosions. This keyword would probably not be used by a level designer.</p>
|
||||
|
||||
<h3>rgbGen oneMinusEntity</h3>
|
||||
<p>As rgbGen entity, but inverted.</p>
|
||||
|
||||
<h3>rgbGen lightingDiffuse</h3>
|
||||
<p>Colors are computed using a standard diffuse lighting equation. It uses the vertex normals to illuminate the object correctly.</p>
|
||||
<blockquote>
|
||||
<h4>Design Notes:</h4>
|
||||
<p>rgbGen lightingDiffuse is used when you want the RGB values to be computed for a dynamic model (i.e. non-map object) in the world using regular in-game lighting. For example, you would specify on shaders for items, characters, weapons, etc.</p>
|
||||
</blockquote>
|
||||
|
||||
<h3>rgbGen noise</h3>
|
||||
<p>(Probably doesn't exist)</p>
|
||||
|
||||
<h3>rgbGen wave <em>func base amplitude phase freq</em></h3>
|
||||
<p>Colors are generated using the specified waveform. An affected texture with become darker and lighter, but will not change hue. Hue stays constant. Note that the RGB values for color will not go below 0 (black) or above 1 (white). Valid waveforms are sin, triangle, square, sawtooth, inversesawtooth and noise (see Waveform Functions).</p>
|
||||
|
||||
<h3>rgbGen const ( <em>R G B</em> )</h3>
|
||||
<p>A constant vertex colour is assigned to the affected surface. This modifies the hue of the texture.</p>
|
||||
|
||||
<h2 id="alphaGen">alphaGen func</h2>
|
||||
<p>The alpha channel can be specified like the RGB channels. If not specified, it defaults to 1.0.</p>
|
||||
|
||||
<h3>alphaGen lightingSpecular</h3>
|
||||
<h3>alphaGen wave</h3>
|
||||
<h3>alphaGen entity</h3>
|
||||
<h3>alphaGen oneMinusEntity</h3>
|
||||
<h3>alphaGen vertex</h3>
|
||||
<h3>alphaGen oneMinusVertex</h3>
|
||||
|
||||
<h3>alphaGen const N.N</h3>
|
||||
<p>A constant vertex alpha is assigned to the affected surface. This modifies the transparency of the texture.</p>
|
||||
|
||||
<h3>alphaGen portal</h3>
|
||||
<p>This rendering stage keyword is used in conjunction with the surface parameter keyword portal. The function accomplishes the "fade" that causes the scene in the portal to fade from view. Specifically, it means "Generate alpha values based on the distance from the viewer to the portal." Use alphaGen portal on the last rendering pass.</p>
|
||||
|
||||
<h2 id="tcGen">tcGen coordinateSource</h2>
|
||||
<p>Specifies how texture coordinates are generated and where they come from. Valid functions are base, lightmap, environment and vector.</p>
|
||||
|
||||
<dl>
|
||||
<dt>base</dt><dd>Base texture coordinates from the original art.</dd>
|
||||
<dt>lightmap</dt><dd>Lightmap texture coordinates.</dd>
|
||||
<dt>environment</dt><dd>Projects a texture from environment mapping (typically used for shiny reflective surfaces like polished steel).</dd>
|
||||
<dt>vector</dt><dd>Projects a texture from a specified direction.</dd>
|
||||
</dl>
|
||||
|
||||
<h3>tcGen vector ( <em>sx sy sz</em> ) ( <em>tx ty tz</em> )</h3>
|
||||
<p>New texture coordinate generation by world projection. This allows you to project a texture onto a surface in a fixed way, regardless of its orientation.</p>
|
||||
|
||||
<p>S-coordinates correspond to the "x" coordinates on the texture itself. T-coordinates correspond to the "y" coordinates on the texture itself. The measurements are in game units.</p>
|
||||
|
||||
<p>Example:<p>
|
||||
<pre>tcGen vector ( 0.01 0 0 ) ( 0 0.01 0 )</pre>
|
||||
<p>This would project a texture with a repeat every 100 units across the X/Y plane. The value comes from dividing the game units from 1, in this case, 1/100.</p>
|
||||
|
||||
<h2 id="tcMod">tcMod <em>func</em></h2>
|
||||
<p>Specifies how texture coordinates are modified after they are generated. The valid functions for tcMod are rotate, scale, scroll, stretch, transform and turb. Transform is a function generally reserved for use by programmers who suggest that designers leave it alone. When using multiple tcMod functions during a stage, place the scroll command last in order, because it performs a mod operation to save precision, and that can disturb other operations. Texture coordinates are modified in the order in which tcMods are specified. In otherwords, if you see the following, the texture coordinates will be scaled, then scrolled.</p>
|
||||
|
||||
<pre>
|
||||
tcMod scale 0.5 0.5
|
||||
tcMod scroll 1 1
|
||||
</pre>
|
||||
|
||||
<h3>tcMod rotate <em>degrees/sec</em></h3>
|
||||
<p>This keyword causes the texture coordinates to rotate. The value is expressed in degrees rotated each second. A positive value means clockwise rotation. A negative value means counterclockwise rotation. For example "tcMod rotate 5" would rotate texture coordinates 5 degrees each second in a clockwise direction. The texture rotates around the center point of the texture map, so you are rotating a texture with a single repetition, be careful to center it on the brush (unless off-center rotation is desired).</p>
|
||||
|
||||
<h3>tcMod scale <em>sScale tScale</em></h3>
|
||||
<p>Resizes (enlarges or shrinks) the texture coordinates by multiplying them against the given factors of sScale and tScale. The values "s" and "t"conform to the "x" and "y" values (respectively) as they are found in the original texture TGA. The values for sScale and tScale are NOT normalized. This means that a value greater than 1.0 will increase the size of the texture. A positive value less than one will reduce the texture to a fraction of its size and cause it to repeat within the same area as the original texture (Note: see clampTexCoords for ways to control this).</p>
|
||||
|
||||
<p>Example: tcMod scale 0.5 2 would cause the texture to repeat twice along its width, but expand to twice its height (in which case half of the texture would be seen in the same area as the original)</p>
|
||||
|
||||
<h3>tcMod scroll <em>sSpeed tSpeed</em></h3>
|
||||
<p>Scrolls the texture coordinates with the given speeds. The values "s" and "t" conform to the "x" and "y" values (respectively) as they are found in the original texture TGA. The scroll speed is measured in "textures" per second. A "texture" is the dimension of the texture being modified and includes any previous shader modifications to the original TGA). A negative s value would scroll the texture to the left. A negative t value would scroll the texture down.</p>
|
||||
|
||||
<p>Example: tcMod scroll 0.5 -0.5 moves the texture down and right (relative to the TGA files original coordinates) at the rate of a half texture each second of travel.</p>
|
||||
|
||||
<p>This should be the LAST tcMod in a stage. Otherwise there may be a popping or snapping visual effect in some shaders.</p>
|
||||
|
||||
<h3>tcMod stretch <em>func base amplitude phase frequency</em></h3>
|
||||
<p>Stretches the texture coordinates with the given function. Stretching is defined as stretching the texture coordinate away from the center of the polygon and then compressing it towards the center of the polygon. (see Chapter 1: Key Concepts for waveform parameter definitions).</p>
|
||||
|
||||
<h3>tcMod transform <em>m00 m01 m10 m11 t0 t1</em></h3>
|
||||
<p>Transforms each texture coordinate as follows:</p>
|
||||
<pre>
|
||||
S' = s * m00 + t * m10 + t0
|
||||
T' = s * m01 + t * m11 + t1
|
||||
</pre>
|
||||
<p>This is primarily used by programmers.</p>
|
||||
|
||||
<h3>tcMod turb <em>base amplitude phase frequency</em></h3>
|
||||
<p>Applies turbulence to the texture coordinate. Turbulence is a back and forth churning and swirling effect on the texture.</p>
|
||||
|
||||
<dl>
|
||||
<dt>base</dt><dd>Undefined</dd>
|
||||
<dt>amplitude</dt><dd>This is essentially the intensity of the disturbance or twisting and squiggling of the texture.</dd>
|
||||
<dt>phase</dt><dd>See the explanation for phase under the deformVertexes keyword.</dd>
|
||||
<dt>frequency</dt><dd>Frequency. This value is expressed as repetitions or cycles of the wave per second. A value of one would cycle once per second. A value of 10 would cycle 10 times per second. A value of 0.1 would cycle once every 10 seconds.</dd>
|
||||
</dl>
|
||||
|
||||
<h2 id="depthFunc">depthFunc <em>func</em></h2>
|
||||
<p>This controls the depth comparison function used while rendering. The default is "lequal" (Less than or equal to) where any surface that is at the same depth or closer of an existing surface is drawn. This is used for textures with transparency or translucency. Under some circumstances you may wish to use "equal", e.g. for light-mapped grates that are alpha tested (it is also used for mirrors).</p>
|
||||
|
||||
<h2 id="depthWrite">depthWrite</h2>
|
||||
<p>By default, writes to the depth buffer when depthFunc passes will happen for opaque surfaces and not for translucent surfaces. Blended surfaces can have the depth writes forced with this function.</p>
|
||||
|
||||
<h2 id="detail">detail</h2>
|
||||
<p>This feature was not used in Quake III Arena maps, but still functions. Designates this stage as a detail texture stage, which means that if the c_var, r_detailtextures, is set to 0 then this stage will be ignored (detail will not be displayed). This keyword, by itself, does not affect rendering at all. If you do put in a detail texture, it has to conform to very specific rules. Specifically, the blendFunc:</p>
|
||||
|
||||
<pre>
|
||||
blendFunc GL_DST_COLOR GL_SRC_COLOR
|
||||
</pre>
|
||||
|
||||
<p>This is also the simple blend function: blendFunc filter</p>
|
||||
|
||||
<p>And the average intensity of the detail texture itself must be around 127.</p>
|
||||
|
||||
<p>Detail is used to blend fine pixel detail back into a base texture whose scale has been increased significantly. When detail is written into a set of stage instructions, it allows the stage to be disabled by the c_var console command setting "r_detailtextures 0".</p>
|
||||
|
||||
<p>A texture whose scale has been increased beyond a 1:1 ratio tends not to have very high frequency content. In other words, one texel can cover a lot of real estate. Frequency is also known as "detail." Lack of detail can appear acceptable if the player never has the opportunity to see the texture at close range. But seen close up, such textures look glaringly wrong within the sharp detail of the Quake III Arena environment. A detail texture solves this problem by taking a noisy "detail" pattern (a tiling texture that appears to have a great deal of surface roughness) and applying it to the base texture at a very densely packed scale (that is, reduced from its normal size). This is done programmatically in the shader, and does not require modification of the base texture. Note that if the detail texture is the same size and scale as the base texture that you may as well just add the detail directly to the base texture. The theory is that the detail texture's scale will be so high compared to the base texture (e.g.; 9 detail texels fitting into 1 base texel) that it is literally impossible to fit that detail into the base texture directly.</p>
|
||||
|
||||
<p>For this to work, the rules are as follows:</p>
|
||||
<ul>
|
||||
<li>The lightmap must be rendered first. This is because the subsequent detail texture will be modifying the lightmap in the framebuffer directly.</li>
|
||||
<li>The base texture must be rendered next.</li>
|
||||
<li>The detail texture must be rendered last since it modifies the lightmap in the framebuffer. There is a bug in Quake III that disables all stages in a shader after a "detail" stage if r_detailTextures is set to 0.</li>
|
||||
<li>The detail texture MUST have a mean intensity around 127-129. If it does not then it will modify the displayed texture's perceived brightness in the world.</li>
|
||||
<li>The detail shader stage MUST have the "detail" keyword or it will not be disabled if the user uses the "r_detailtextures 0" setting.</li>
|
||||
<li>The detail stage MUST use "blendFunc GL_DST_COLOR GL_SRC_COLOR". Any other BlendFunc will cause mismatches in brightness between detail and non-detail views.</li>
|
||||
<li>The detail stage should scale its textures by some amount (usually between 3 and 12) using "tcMod scale" to control density. This roughly corresponds to coarseness. A very large number, such as 12, will give very fine detail, however that detail will disappear VERY quickly as the viewer moves away from the wall since it will be MIP mapped away. A very small number, e.g. 3, gives diminishing returns since not enough is brought in when the user gets very close. I'm currently using values between 6 and 9.5. You should use non-integral numbers as much as possible to avoid seeing repeating patterns.</li>
|
||||
<li>Detail textures add one pass of overdraw, so there is a definite performance hit.</li>
|
||||
<li>Detail textures can be shared, so designers may wish to define only a very small handful of detail textures for common surfaces such as rocks, etc.</li>
|
||||
</ul>
|
||||
|
||||
<p>An example (non-existent) detail shader is as follows:</p>
|
||||
|
||||
<pre>
|
||||
textures/bwhtest/foo
|
||||
{
|
||||
q3map_globalTexture //may be required when using tcMod scale in later stages
|
||||
|
||||
// draw the lightmap first
|
||||
{
|
||||
map $lightmap
|
||||
rgbGen identity
|
||||
}
|
||||
|
||||
// draw the base texture
|
||||
{
|
||||
map textures/castle/blocks11b.tga
|
||||
blendFunc filter
|
||||
}
|
||||
|
||||
// highly compressed detail texture
|
||||
{
|
||||
map textures/details/detail01.tga
|
||||
blendFunc GL_DST_COLOR GL_SRC_COLOR //MUST BE USED
|
||||
detail //allows detail shaders to be disabled
|
||||
tcMod scale 9.1 9.2
|
||||
}
|
||||
}
|
||||
</pre>
|
||||
|
||||
<h2 id="alphaFunc">alphaFunc <em>func</em></h2>
|
||||
|
||||
<p>Determines the alpha test function used when rendering this map. Valid values are GT0, LT128, and GE128. These correspond to "GREATER THAN 0", "LESS THAN 128", and "GREATER THAN OR EQUAL TO 128". This function is used when determining if a pixel should be written to the framebuffer. For example, if GT0 is specified, the only the portions of the texture map with corresponding alpha values greater than zero will be written to the framebuffer. By default alpha testing is disabled.</p>
|
||||
|
||||
<p>Both alpha testing and normal alpha blending can be used to get textures that have see-through parts. The difference is that alphaFunc is an all-or-nothing test, while blending smoothly blends between opaque and translucent at pixel edges. Alpha test can also be used with depthWrite, allowing other effects to be conditionally layered on top of just the opaque pixels by setting depthFunc to equal.</p>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
122
docs/shaderManual/terrain-and-alphamod-blends.html
Normal file
|
|
@ -0,0 +1,122 @@
|
|||
<?xml version="1.1" encoding="iso-8859-1"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
|
||||
<head>
|
||||
<title>Q3Map2 Shader Manual</title>
|
||||
<meta name="keywords" content="id software, quake, radiant, qeradiant, gtkradiant, q3map, q3map2, shader, manual, ydnar, obsidian" />
|
||||
<meta name="description" content="Q3Map2 Shader Manual" />
|
||||
<meta name="copyright" content="Obsidian © 2010" />
|
||||
<link rel="stylesheet" href="default.css" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/_css/default.css" type="text/css" media="all" title="Default styles" />
|
||||
</head>
|
||||
<body id="articles">
|
||||
|
||||
<div id="nav">
|
||||
<div id="navbutton">
|
||||
<ul>
|
||||
<div id="navtop"></div>
|
||||
<li><a href="index.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/index.html">Q3Map2 Shader Manual</a></li>
|
||||
<li><a href="contents.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/contents.html">Full Contents</a></li>
|
||||
<li>Introduction
|
||||
<ul>
|
||||
<li><a href="preface.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/preface.html">Preface</a></li>
|
||||
<li><a href="shader-concepts.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/shader-concepts.html">Shader Concepts</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Directives
|
||||
<ul>
|
||||
<li><a href="general-directives.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/general-directives.html">General Directives</a></li>
|
||||
<li><a href="q3map-global-directives.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-global-directives.html">Q3Map Global Directives</a></li>
|
||||
<li><a href="q3map-surface-parameter-directives.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-surface-parameter-directives.html">Q3Map Surface Parameter Directives</a></li>
|
||||
<li><a href="quake-editor-radiant-directives.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/quake-editor-radiant-directives.html">Quake Editor Radiant Directives</a></li>
|
||||
<li><a href="stage-directives.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/stage-directives.html">Stage Directives</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Articles
|
||||
<ul>
|
||||
<li><a href="texture-creation.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/texture-creation.html">Texture Creation</a></li>
|
||||
<li><a href="alpha-channels.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/alpha-channels.html">Alpha Channels</a></li>
|
||||
<li><a href="light-emitting-shaders.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/light-emitting-shaders.html">Light Emitting Shaders</a></li>
|
||||
<li><a href="lightstyles.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/lightstyles.html">Lightstyles</a></li>
|
||||
<li><a href="cel-shading.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/cel-shading.html">Cel Shading</a></li>
|
||||
<li><a href="decal-tricks.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/decal-tricks.html">Decal Tricks</a></li>
|
||||
<li><a href="foghull.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/foghull.html">Foghull</a></li>
|
||||
<li><a href="fur.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/fur.html">Fur</a></li>
|
||||
<li><a href="terrain-and-alphamod-blends.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/terrain-and-alphamod-blends.html">Terrain and alphaMod Blends</a></li>
|
||||
<li><a href="triggerable-shader-entities.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/triggerable-shader-entities.html">Triggerable Shader Entities</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<div id="navlow"></div>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h1>Terrain</h1>
|
||||
<p>Q3Map2 terrain has changed radically since Quake III: Team Arena first hit the shelves. Alphamapped terrain shaders are difficult to set up, limiting and lacks the ability for the mapper to fine tune the effect. The new terrain improvements in Q3Map2 have removed these difficulties, allowing the mapper to fully exploit terrain shaders for breathtaking outdoor scenes. This section will assume that you are already familiar with the method of setting up a standard alphamapped terrain as described in the Terrain Construction for Quake 3 Engine Games manual by Paul Jaquays, and will focus on the new enhanced features of Q3Map2 terrain.</p>
|
||||
|
||||
<h2>General Changes</h2>
|
||||
<p>Q3Map2 terrain has changed dramatically in terms of not only visually, but also in terms of how it is processed by the compiler. To ensure compatibility, there needs to be a few changes. Foremost, make sure that all terrain shader files are listed in the shaderlist.txt file.</p>
|
||||
|
||||
<p>Before using Q3Map2 alphamapped terrain, it must be noted that terrain is now handled completely different than before. Q3Map2 no longer looks for the word terrain in the shader name to determine whether or not it is an indexed shader. Instead it looks for q3map_indexed or q3map_terrain. For this reason, the alphamap terrain shaders have been slightly modified. If using Q3Map2 alphamaps, make sure that your "textures/common/terrain" and "textures/common/terrain2" shaders have been updated to the following:</p>
|
||||
|
||||
<pre>
|
||||
textures/common/terrain
|
||||
{
|
||||
q3map_terrain
|
||||
surfaceparm nodraw
|
||||
surfaceparm nolightmap
|
||||
surfaceparm nomarks
|
||||
}
|
||||
|
||||
textures/common/terrain2
|
||||
{
|
||||
q3map_terrain
|
||||
qer_editorimage textures/common/terrain.tga
|
||||
surfaceparm dust
|
||||
surfaceparm nodraw
|
||||
surfaceparm nomarks
|
||||
surfaceparm nolightmap
|
||||
}
|
||||
</pre>
|
||||
|
||||
<h3>Base Shader</h3>
|
||||
<p>To simplify the terrain shader writing process, a base shader can be used as a template with subclassed shaders referencing it. This makes use of the q3map_baseShader directive. The base shader can consist of all q3map_* directives and must be processed before all other terrain shaders referencing it. The use of a base shader is recommend for all terrain shaders.</p>
|
||||
|
||||
<h3>tcMod Functions</h3>
|
||||
<p>q3map_tcMod can be used on terrain shaders to minimize any obvious texture tiling, particularly q3map_tcMod rotate. In some situations q3map_tcMod scale or the stage driven tcMod scale may be used to scale the textures - though typically tcGen texture projection functions are usually the preferred method.</p>
|
||||
|
||||
<h3>tcGen Functions</h3>
|
||||
<p>In most situations, terrain textures will need to be projected onto the terrain mesh. This is achieved by using either q3map_tcGen function or the stage specific tcGen. Any tcGen functions will overwrite any tcMod scale functions.</p>
|
||||
|
||||
<h2>Lightmapped Terrain</h2>
|
||||
<p>The foremost improvement to Q3Map2 terrain is the ability to use lightmaps as a lighting system rather than basic vertex lighting. This allows terrain to not only cast detailed shadows onto itself, but also allows other map geometry to cast shadows onto the terrain as well. The additional rendering pass of the lightmap creates a slight performance hit as a price for the improved visuals. Several new q3map_* directives are typically used to tweak the terrain lightmap:</p>
|
||||
|
||||
<h3>q3map_nonPlanar</h3>
|
||||
<p>Required on all terrain shaders, q3map_nonPlanar allows shadows to be cast across non-planar edges. This fixes a problem where lightmapped terrain would not light properly across uneven surfaces.</p>
|
||||
|
||||
<h3>q3map_lightmapAxis</h3>
|
||||
<p>Optionally used, q3map_lightmapAxis can be used to specify the axis in which the lightmap is projected from. This is typically used on normal triangle-quad souped terrain and is set implicitly to "q3map_lightmapAxis z" with q3map_terrain. It is not recommended for terrain with caves or undersides.</p>
|
||||
|
||||
<h3>q3map_shadeAngle</h3>
|
||||
<p>Most terrain artists will choose to enable triangle edge shadow smoothing to reduce the appearance of sharp shadow edges across the terrain mesh. q3map_shadeAngle specifies the triangle edge angle at which the light will be diffused. For best results, it is recommended that you start with low values and tweak the angle parameter in small increments until a satisfactory result is produced. Overly high values will wash out shadow details.</p>
|
||||
|
||||
<h3>q3map_lightmapMergable</h3>
|
||||
<p>Setting q3map_lightmapMergable merges all terrain into one seamless lightmap, reducing the appearance of artifacts spanning across separate lightmap images.</p>
|
||||
|
||||
<h3>q3map_lightmapSampleSize</h3>
|
||||
<p>Lightmapped terrain can be very memory intensive as Q3Map2 has to typically generate a large amount of lightmap data. q3map_lightmapSampleSize can be used to reduce the amount of lightmap memory used by limiting the resolution of the lightmap images. Similarly, it can also be used to increase the lightmap resolution at the cost of memory.</p>
|
||||
|
||||
<h3>q3map_lightmapSampleOffset</h3>
|
||||
<p>If experiencing lightmap splotches over the surface of terrain lightmaps, q3map_lightmapSampleOffset can be used to fix this. For best results, start with small numbers (default 1.0) and slowly increase this value until the splotches disappear. Overly high values will cause unsatisfactory results.</p>
|
||||
|
||||
|
||||
<h2>AlphaMod Dotproduct Terrain</h2>
|
||||
<p>AlphaMod dotproduct terrain is a revolutionary way in which Q3Map2 terrain is blended. It removes the need for an alphamap and metashader and automatically determines the blending of terrain depending on the vertex normals of the terrain mesh. Equally important, this new system removes the need of a triangle-quad grid, allowing the designer to create a terrain mesh using any triangle shape or size.</p>
|
||||
|
||||
|
||||
<h2>AlphaMod Volume Terrain</h2>
|
||||
<p>Following the automatic generation of dotproduct blending, alphaMod volume terrain blending was developed to give direct control of the alpha blending back to the designer. Using this system the designer can modify the exact location and amount of blending to occur, directly from within the editor.</p>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
109
docs/shaderManual/texture-creation.html
Normal file
|
|
@ -0,0 +1,109 @@
|
|||
<?xml version="1.1" encoding="iso-8859-1"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
|
||||
<head>
|
||||
<title>Q3Map2 Shader Manual</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||
<meta name="keywords" content="id software, quake, radiant, qeradiant, gtkradiant, q3map, q3map2, shader, manual, ydnar, obsidian" />
|
||||
<meta name="description" content="Q3Map2 Shader Manual" />
|
||||
<meta name="copyright" content="Obsidian © 2010" />
|
||||
<link rel="stylesheet" href="default.css" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/_css/default.css" type="text/css" media="all" title="Default styles" />
|
||||
</head>
|
||||
<body id="article_texture_creation">
|
||||
|
||||
<div id="nav">
|
||||
<div id="navbutton">
|
||||
<ul>
|
||||
<div id="navtop"></div>
|
||||
<li><a href="index.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/index.html">Q3Map2 Shader Manual</a></li>
|
||||
<li><a href="contents.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/contents.html">Full Contents</a></li>
|
||||
<li>Introduction
|
||||
<ul>
|
||||
<li><a href="preface.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/preface.html">Preface</a></li>
|
||||
<li><a href="shader-concepts.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/shader-concepts.html">Shader Concepts</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Directives
|
||||
<ul>
|
||||
<li><a href="general-directives.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/general-directives.html">General Directives</a></li>
|
||||
<li><a href="q3map-global-directives.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-global-directives.html">Q3Map Global Directives</a></li>
|
||||
<li><a href="q3map-surface-parameter-directives.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-surface-parameter-directives.html">Q3Map Surface Parameter Directives</a></li>
|
||||
<li><a href="quake-editor-radiant-directives.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/quake-editor-radiant-directives.html">Quake Editor Radiant Directives</a></li>
|
||||
<li><a href="stage-directives.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/stage-directives.html">Stage Directives</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Articles
|
||||
<ul>
|
||||
<li><a href="texture-creation.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/texture-creation.html">Texture Creation</a></li>
|
||||
<li><a href="alpha-channels.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/alpha-channels.html">Alpha Channels</a></li>
|
||||
<li><a href="light-emitting-shaders.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/light-emitting-shaders.html">Light Emitting Shaders</a></li>
|
||||
<li><a href="lightstyles.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/lightstyles.html">Lightstyles</a></li>
|
||||
<li><a href="cel-shading.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/cel-shading.html">Cel Shading</a></li>
|
||||
<li><a href="decal-tricks.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/decal-tricks.html">Decal Tricks</a></li>
|
||||
<li><a href="foghull.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/foghull.html">Foghull</a></li>
|
||||
<li><a href="fur.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/fur.html">Fur</a></li>
|
||||
<li><a href="terrain-and-alphamod-blends.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/terrain-and-alphamod-blends.html">Terrain and alphaMod Blends</a></li>
|
||||
<li><a href="triggerable-shader-entities.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/triggerable-shader-entities.html">Triggerable Shader Entities</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<div id="navlow"></div>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h1>Texture Creation</h1>
|
||||
<p>If you are familiar with the required tools, creating new assets for use in Quake III Arena is not particularly difficult. As a general rule, you should create new directories for each map with names different from the names used by id. If you are making a map that will be called "H4x0r_D00M", every directory containing new assets for that map should be titled H4x0r_D00M. This is to try and avoid asset directories overwriting each other as the editor and the gameload in assets.</p>
|
||||
|
||||
<h2>Tools Needed</h2>
|
||||
<p>Any combination of graphic programs and plug-ins that canout put a 24 bit MS windows compatible Targa (.tga) or JPEG (.jpg) graphic file.If you plan to make textures that will have an alpha channel component (a 4th 8-bit greyscale channel that is used by the shaders to further manipulate the art), you must have a program that can create 32-bit art with that fourth channel.</p>
|
||||
<p>Adobe Photoshop has the ability to easily create alpha channels. PaintShop Pro from Corel (v5.0+) can also make an alpha channel by creating a mask and naming it "alpha". Free and open source GIMP also works quite well.</p>
|
||||
<p>Generally speaking, regardless of the program used, we found it best to do most of the art manipulation of the alpha channel in a separate layer or file and then paste it into the alpha channel before saving.</p>
|
||||
|
||||
<h2>Setting up Files</h2>
|
||||
<p>The editor and the game program look for assets to be located along the paths set up in your project file. Start by creating a directory for you new textures by creating file folders to make a directory path as follows:</p>
|
||||
<pre>
|
||||
quake3\baseq3\textures\[mymapname]
|
||||
</pre>
|
||||
<p>The installation of Q3Radiant will create a text document called "shaderlist.txt" in the following path:</p>
|
||||
<pre>
|
||||
quake3\baseq3\scripts\shaderlist.txt
|
||||
</pre>
|
||||
<p>Q3Radiant will use the contents of this script to grab your new textures for inclusion in the game. The contents of shaderlist.txt document will contain a listing of all the shader documents that were used by id Software to create Quake III Arena.</p>
|
||||
<p>Since you will obviously want to create your own shaders, you need to put them in separate folders and create a new shader script for them.</p>
|
||||
<p>If you plan to work on several maps at once and want to distinguish between textures used in each map, simply add additional map names here. For map and mod makers, we STRONGLY recommend that any new shader scripts created use the name of the map or mod in the shader file name. We know we can't avoid every incident of files overwriting each other, but we certainly can advise you how to try.</p>
|
||||
<p>Now, in the scripts directory that you just created, create another text file and call it:</p>
|
||||
<pre>
|
||||
[mymapname].shader
|
||||
</pre>
|
||||
<p>This file will contain the shader scripts you write to modify a particular texture.</p>
|
||||
<h2>Rules and Guidelines</h2>
|
||||
<p>Follow these rules when creating textures for the Quake III Arena engine:</p>
|
||||
<ul>
|
||||
<li>Save your textures into your new [map name] directories.</li>
|
||||
<li>Don't use the same names that id used for textures. It will cause problems.</li>
|
||||
<li>For best quality, save textures without an alpha channel as 24 bit TARGA files. Using JPEG files can save memory space, but at the risk of losing detail and depth in the texture. JPEG files cannot be used for textures requiring an alpha channel.</li>
|
||||
<li>Textures containing an alpha channel must be saved as32 bit TARGA files.</li>
|
||||
<li>If a new texture requires no further manipulation, it does not need a shader script.</li>
|
||||
<li>Size textures in powers of 2. Example: 8x8, 16x16,32x32, 64x64 pixels and so on.</li>
|
||||
<li>Textures don't need to be square. A 32x256 pixel texture is perfectly acceptable.</li>
|
||||
</ul>
|
||||
<p>The following are some things the id designers learned about textures.</p>
|
||||
<ul>
|
||||
<li>Create textures in "suites" built around one or two large textures with a number of much smaller supporting detail or accent textures.</li>
|
||||
<li>Very large textures are possible, but some video cards compress textures larger than 256x256 pixels.</li>
|
||||
<li>Textures are grouped alphabetically by name in the texture display window, so you may want to give suites of textures similar names.</li>
|
||||
<li>Use the shader function qe3_editorimage to conserve memory when making multiple versions of a single texture (as in the case of a glowing texture with several light values).</li>
|
||||
<li>Unless you are creating special effects or textures designed to draw the player's eye to a specific spot, muted, middle value colors work best with the game engine.</li>
|
||||
<li>Extremely busy (a lot of fussy detail) textures can break up or form visually unpleasant patterns when seen at distances.</li>
|
||||
</ul>
|
||||
|
||||
<h2>Making the .pk3 File</h2>
|
||||
<p>When you go to distribute your creation to the gaming world, you need to put your newly created map, textures, bot area files, and shader documents into an archive format called a "pk3" file. You do not need to include the shaderlist.txt file, since that is only used by the editor. You will need to keep the paths to the various assets the same. So your paths should be something like this:</p>
|
||||
<pre>
|
||||
Textures: baseq3/textures/[mymapnamefolder]
|
||||
Bsp & aas: baseq3/maps/mymapname.bsp, mymapname.aas
|
||||
Shader scripts: baseq3/scripts/mymapname.shader
|
||||
</pre>
|
||||
<p>You need to use a "zip" archiving program (<a href="http://www.7-zip.org/" tppabs="http://www.7-zip.org/">7-zip</a> for example) to make the pk3 file. Make a zip archive called mymapname.zip. Zip all the required assets into a zip archive file (Quake III Arena DOES support compressed pk3 files). Rename the zip archive to mymapname.pk3. Put it where the Quake III Arena community can find it.</p>
|
||||
BIN
docs/shaderManual/title.gif
Normal file
|
After Width: | Height: | Size: 2.5 KiB |
BIN
docs/shaderManual/titleImage.jpg
Normal file
|
After Width: | Height: | Size: 25 KiB |
78
docs/shaderManual/triggerable-shader-entities.html
Normal file
|
|
@ -0,0 +1,78 @@
|
|||
<?xml version="1.1" encoding="iso-8859-1"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
|
||||
<head>
|
||||
<title>Q3Map2 Shader Manual</title>
|
||||
<meta name="keywords" content="id software, quake, radiant, qeradiant, gtkradiant, q3map, q3map2, shader, manual, ydnar, obsidian" />
|
||||
<meta name="description" content="Q3Map2 Shader Manual" />
|
||||
<meta name="copyright" content="Obsidian © 2010" />
|
||||
<link rel="stylesheet" href="default.css" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/_css/default.css" type="text/css" media="all" title="Default styles" />
|
||||
</head>
|
||||
<body id="articles">
|
||||
|
||||
<div id="nav">
|
||||
<div id="navbutton">
|
||||
<ul>
|
||||
<div id="navtop"></div>
|
||||
<li><a href="index.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/index.html">Q3Map2 Shader Manual</a></li>
|
||||
<li><a href="contents.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/contents.html">Full Contents</a></li>
|
||||
<li>Introduction
|
||||
<ul>
|
||||
<li><a href="preface.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/preface.html">Preface</a></li>
|
||||
<li><a href="shader-concepts.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/shader-concepts.html">Shader Concepts</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Directives
|
||||
<ul>
|
||||
<li><a href="general-directives.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/general-directives.html">General Directives</a></li>
|
||||
<li><a href="q3map-global-directives.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-global-directives.html">Q3Map Global Directives</a></li>
|
||||
<li><a href="q3map-surface-parameter-directives.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/q3map-surface-parameter-directives.html">Q3Map Surface Parameter Directives</a></li>
|
||||
<li><a href="quake-editor-radiant-directives.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/quake-editor-radiant-directives.html">Quake Editor Radiant Directives</a></li>
|
||||
<li><a href="stage-directives.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/stage-directives.html">Stage Directives</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Articles
|
||||
<ul>
|
||||
<li><a href="texture-creation.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/texture-creation.html">Texture Creation</a></li>
|
||||
<li><a href="alpha-channels.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/alpha-channels.html">Alpha Channels</a></li>
|
||||
<li><a href="light-emitting-shaders.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/light-emitting-shaders.html">Light Emitting Shaders</a></li>
|
||||
<li><a href="lightstyles.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/lightstyles.html">Lightstyles</a></li>
|
||||
<li><a href="cel-shading.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/cel-shading.html">Cel Shading</a></li>
|
||||
<li><a href="decal-tricks.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/decal-tricks.html">Decal Tricks</a></li>
|
||||
<li><a href="foghull.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/foghull.html">Foghull</a></li>
|
||||
<li><a href="fur.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/fur.html">Fur</a></li>
|
||||
<li><a href="terrain-and-alphamod-blends.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/terrain-and-alphamod-blends.html">Terrain and alphaMod Blends</a></li>
|
||||
<li><a href="triggerable-shader-entities.html" tppabs="http://robotrenegade.com/q3map2/docs/shader_manual/triggerable-shader-entities.html">Triggerable Shader Entities</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<div id="navlow"></div>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h1>Triggerable Shader Entities</h1>
|
||||
<p>The targetShaderName and targetShaderNewName keys can be used with any entity that supports the target key (the entity instance does not actually have to use the target key for these new keys to work). If both are defined, then when the entity decides to activate its targets, all shaders/textures in the map that were originally the same name as the targetShaderName value, will be changed to the targetShaderNewName value.
|
||||
For example this would make it look like the red light shader is "turning on":</p>
|
||||
|
||||
<pre>
|
||||
"targetShaderName" "textures/proto2/redlight_off"
|
||||
"targetShaderNewName" "textures/proto2/redlight_on"
|
||||
</pre>
|
||||
|
||||
<p>And this would turn it back off:</p>
|
||||
|
||||
<pre>
|
||||
"targetShaderName" "textures/proto2/redlight_off"
|
||||
"targetShaderNewName" "textures/proto2/redlight_off"
|
||||
</pre>
|
||||
|
||||
<p>Note that the ORIGINAL shader name is used in both instances, not whatever it happens to be currently. Also, of course, this will happen globally. If the mapper wanted to affect only a certain set of red lights, he/she would need to make a unique shader name to be used with that set.</p>
|
||||
|
||||
<p>The code that supports these keys is in G_UseTargets in g_utils.c</p>
|
||||
|
||||
<p>-TTimo, 31.08.01</p>
|
||||
|
||||
</body>
|
||||
</html>
|
||||