Skip to content

Commit

Permalink
shader manual: crosslink, improve
Browse files Browse the repository at this point in the history
  • Loading branch information
Garux committed Dec 29, 2024
1 parent a3742e3 commit c243592
Show file tree
Hide file tree
Showing 17 changed files with 335 additions and 321 deletions.
2 changes: 1 addition & 1 deletion docs/shaderManual/alpha-channels.html
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ <h1>Alpha Channels</h1>

<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>Make a <a href="quake-editor-radiant-directives.html#qer_editorImage">qer_editorImage</a> 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>

Expand Down
288 changes: 144 additions & 144 deletions docs/shaderManual/contents.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/shaderManual/decal-tricks.html
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ <h2>Inverse Multiplicative Shadows</h2>
}
</pre>

<h2>Using _decal Entities</h2>
<h2 id="_decal">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>

Expand All @@ -121,7 +121,7 @@ <h2>Using _decal Entities</h2>

<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>It will project onto terrain, brushes, models, patches, whatever. To suppress decals on particular shaders, use <a href="q3map-surface-parameter-directives.html#nomarks">surfaceparm nomarks</a>.</p>

<p>Happy decaling!</p>

Expand Down
6 changes: 3 additions & 3 deletions docs/shaderManual/foghull.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,12 @@ <h2>What is a Foghull?</h2>
<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 obscure 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>
<p>The skybox images used with the foghull feature should never be actually seen since the idea is to use the fog to obscure 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 <a href="general-directives.html#skyParms">skyParms</a> 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>
<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 <a href="general-directives.html#fogParms">fogParms</a> and <a href="q3map-surface-parameter-directives.html#fog">surfaceparm fog</a> keywords must be present.</p>

<pre>
textures/env/fog1024
Expand All @@ -84,7 +84,7 @@ <h2>Foghull Shaders</h2>
}
</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>
<p>The <a href="general-directives.html#skyParms">skyParms</a> and <a href="q3map-surface-parameter-directives.html#sky">surfaceparm sky</a> keywords must be used to create the skybox "hull" of the map. The <a href="general-directives.html#skyParms">skyParms</a> farbox value must point to the base name of the skybox images (sans suffix). Optional surface emitted sun lighting can be added using <a href="q3map-global-directives.html#q3map_skylight">q3map_skylight</a> with <a href="q3map-global-directives.html#q3map_sun">q3map_sun</a> or <a href="q3map-global-directives.html#q3map_sunExt">q3map_sunExt</a> (see Appendix I: <a href="light-emitting-shaders.html">Light Emitting Shaders</a>).</p>

<pre>
textures/skies/foghullsky
Expand Down
2 changes: 1 addition & 1 deletion docs/shaderManual/fur.html
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ <h2>q3map_cloneShader</h2>
</pre>

<h2>q3map_fur</h2>
<p><a href="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>
<p><a href="q3map-global-directives.html#q3map_fur">q3map_fur</a> generates additional surfaces above the base shader. The <a href="q3map-global-directives.html#q3map_fur">q3map_fur</a> 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
Expand Down
Loading

0 comments on commit c243592

Please sign in to comment.