Skip to content

Commit

Permalink
shader manual: consistent indentation and alignment of shaders
Browse files Browse the repository at this point in the history
  • Loading branch information
Garux committed Dec 27, 2024
1 parent 4aedb78 commit a3742e3
Show file tree
Hide file tree
Showing 8 changed files with 96 additions and 95 deletions.
32 changes: 16 additions & 16 deletions docs/shaderManual/alpha-channels.html
Original file line number Diff line number Diff line change
Expand Up @@ -65,23 +65,23 @@ <h1>Alpha Channels</h1>
// Opaque texture with see-through holes knocked in in.
textures/base_floor/pjgrate1
{
surfaceparm metalsteps
cull none
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
}
// 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>

Expand Down
34 changes: 17 additions & 17 deletions docs/shaderManual/cel-shading.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,27 +67,27 @@ <h1>Cel Shading</h1>

textures/cel/ink
{
qer_editorimage gfx/colors/black.tga
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
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
surfaceparm nolightmap
surfaceparm trans
surfaceparm nonsolid
surfaceparm nomarks

sort 16
sort 16

{
map gfx/colors/black.tga
rgbGen identity
}
{
map gfx/colors/black.tga
rgbGen identity
}
}
</pre>

Expand Down
10 changes: 6 additions & 4 deletions docs/shaderManual/foghull.html
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,10 @@ <h2>Foghull Shaders</h2>
<pre>
textures/env/fog1024
{
fogParms ( 0.8 0.8 0.8 ) 1024 //Normalized RGB, distance to opaque
//Normalized RGB, distance to opaque
fogParms ( 0.8 0.8 0.8 ) 1024

surfaceparm fog //Must be used
surfaceparm fog //Must be used
surfaceparm nolightmap
surfaceparm nonsolid
surfaceparm trans
Expand All @@ -88,11 +89,12 @@ <h2>Foghull Shaders</h2>
<pre>
textures/skies/foghullsky
{
skyParms textures/skies/foghullsky 0 - //farbox cloudheight nearbox
//farbox cloudheight nearbox
skyParms textures/skies/foghullsky 0 -

surfaceparm nolightmap
surfaceparm nonsolid
surfaceparm sky //Must be used
surfaceparm sky //Must be used
surfaceparm trans
}
</pre>
Expand Down
17 changes: 9 additions & 8 deletions docs/shaderManual/light-emitting-shaders.html
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,16 @@ <h2>Skies</h2>
<pre>
textures/shadermanual/sky
{
skyparms textures/shaderlab_terrain/env/sky 1024 - //farbox cloudheight nearbox
//farbox cloudheight nearbox
skyparms textures/shaderlab_terrain/env/sky 1024 -

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
q3map_sun 1 1 1 140 -35 25 //red green blue intensity degrees elevation
q3map_lightSubdivide 256 //sets non-default surface light granularity
q3map_surfaceLight 200 //emits 200 units of light

surfaceparm sky //flags compiler that this is sky
surfaceparm sky //flags compiler that this is sky
surfaceparm noimpact
surfaceparm nolightmap
surfaceparm nodlight
Expand Down Expand Up @@ -112,7 +113,7 @@ <h2>Skies</h2>
q3map_lightImage textures/shaderlab_terrain/sky_clouds.tga

q3map_sun 1 1 1 140 -35 25
q3map_skylight 100 3 //amount iterations
q3map_skylight 100 3 //amount iterations

surfaceparm sky
surfaceparm noimpact
Expand Down Expand Up @@ -152,7 +153,7 @@ <h2>Skies</h2>

q3map_lightImage textures/shaderlab_terrain/sky_clouds.tga

q3map_sunExt 1 1 1 140 -35 25 3 16 //adds deviance and samples
q3map_sunExt 1 1 1 140 -35 25 3 16 //adds deviance and samples
q3map_skylight 100 3

surfaceparm sky
Expand Down Expand Up @@ -203,7 +204,7 @@ <h4>Note:</h4>
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_lightmapFilterRadius 0 8 //self other
q3map_skyLight 100 3

surfaceparm sky
Expand Down
56 changes: 28 additions & 28 deletions docs/shaderManual/lightstyles.html
Original file line number Diff line number Diff line change
Expand Up @@ -77,22 +77,22 @@ <h3>Light Emitting Shaders</h3>
<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
}
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>

Expand All @@ -102,18 +102,18 @@ <h2>Lightmapped Surfaces</h2>
<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
}
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>

Expand Down
22 changes: 11 additions & 11 deletions docs/shaderManual/quake-editor-radiant-directives.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,21 +59,21 @@ <h2 id="qer_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
textures/liquids/lavahell2 //path and name of new texture
{
qer_editorImage textures/eerie/lavahell.tga //based on this
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
qer_editorImage textures/eerie/lavahell.tga //based on this
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
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>
Expand Down
14 changes: 7 additions & 7 deletions docs/shaderManual/shader-concepts.html
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,13 @@ <h2 id="whatisashader">What is a Shader?</h2>
<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
}
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>
Expand Down
6 changes: 2 additions & 4 deletions docs/shaderManual/stage-directives.html
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ <h3 id="clampMap">clampMap <em>texturename</em></h3>
<pre>
textures/sfx/metalbridge06_bounce
{
//q3map_surfacelight 2000
surfaceparm nodamage
q3map_lightimage textures/sfx/jumppadsmall.tga
q3map_surfacelight 400
Expand All @@ -105,7 +104,6 @@ <h3 id="clampMap">clampMap <em>texturename</em></h3>
tcMod stretch sin 1.2 .8 0 1.5
rgbGen wave square .5 .5 .25 1.5
}
// END
}
</pre>

Expand Down Expand Up @@ -435,7 +433,7 @@ <h2 id="detail">detail</h2>
<pre>
textures/bwhtest/foo
{
q3map_globalTexture //may be required when using tcMod scale in later stages
q3map_globalTexture //may be required when using tcMod scale in later stages

// draw the lightmap first
{
Expand All @@ -453,7 +451,7 @@ <h2 id="detail">detail</h2>
{
map textures/details/detail01.tga
blendFunc GL_DST_COLOR GL_SRC_COLOR //MUST BE USED
detail //allows detail shaders to be disabled
detail //allows detail shaders to be disabled
tcMod scale 9.1 9.2
}
}
Expand Down

0 comments on commit a3742e3

Please sign in to comment.