New or Revised Q3map Shader Commands
q3map command line switches:
q3map ----- -threads
The q3map options are a subset of the shader instructions that require recompiling of the map.
[NEW] Surfaces using a shader with this option will always be lit with the original "-light" light algorithm. Patches will not cast shadows on this surface unless the shader option q3map_patchshadows is used.
[NEW] When this option is used in conjunction with the original (-light) lighting algorithm, surfaces with textures modified by this option will will show shadows cast by curve patches (under normal circumstances, curve patches do not cast shadows).
[NEW] By default, no shadows are cast on vertex-only lit surfaces (see surfaceparm pointlight). Also when running Quake III Arena in vertex lighting mode, no shadows are cast upon any surfaces (shadows are part of the light map). When using this shader option shadows *will* be cast on the surface when vertex lit. However sharp shadow edges won't be seen on the surface because light values are only calculated at the vertexes.
[NEW] Shaders used for misc_models and terrain can now use q3map_novertexshadows to disable shadows to be cast at the vertex lit surfaces. Shadows being cast at small misc_model objects often makes sense. However shadows on large vertex lit terrain surfaces often look bad. By default no shadows are cast at forced vertex list surfaces ( shaders with "pointlight" ).
[NEW] No sunlight is cast at vertex lit md3 models and terrain by default. Using this option sunlight (overbright bits created by q3map_sun option) will be cast on these surfaces.
[NEW] The light value at the vertexes 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 light only surface in comparison to other, light-map lit surfaces around it.
[NEW] Surfaces modified by a shader with this option are not used for tjunction fixing.
[NEW] Surfaces modified by a shader with this option will always be lit with the "-vlight" algorithm when q3map is used with the options "-vlight -tracelight".
[NEW] Surfaces using a shader with this shader option will use lightmaps with pixel size SxS. This option can be used to produce high resolution shadows on certain surfaces or can be used to reduce the size of lightmap data where high resolution shadows are not required.
Image to use for the light color of a surface light instead of the image(s) used by the shader. Color is averaged from the texture. Texture must be the same size as the base image map.
Sets the amount of light this surface emits.
A surface light is subdivided into a bunch of point lights for the actual lighting of the world. This parameter controls the space between those point lights. Default value is 120.
q3map_backsplash <percent> <distance>
A surface light is also lit by itself using back splash point lights with a lower intensity. The <percent> parameter specifies the intensity percentage they use from the q3map_surfacelight <value> parameter. The <distance> parameter controls the distance of these back splash lights from the surface. You can set the <percent> to zero or a negative value to disable the back splash lights.
When this option is set the texture is not aligned to the world.
<shader> is the path/name of the shader or texture to be used at the back side of the surface.
Creates a flare using the specified <shader> at the center of the surface using a shader with this option.
Old style flare specification always using the shader "flareshader". The <value> parameter is unused.
q3map_sun <red> <green> <blue> <intensity> <degrees> <elevation>
Color will be normalized, so it doesn't matter what range you use. The intensity falls off with angle but not distance. A value of 100 is a fairly bright sun.
degree of 0 = from the east, 90 = north, etc.
elevation of 0 = sunrise/set, 90 = noon
Surfaces using a shader with this parameter will always be vertex lit
This option can be used to reduce the lightmap data. Often used on surfaces
that don't need any shadows.
If a player lands (jumps onto) on a surfaces using a shader with this parameter, a put of dust will appear at the player’s feet. Note that the worldspawn entity of that map must have an enableDust key set to a value of 1.
With the new q3map tool you can add custom surface parameters for mods without the need to recompile the q3map tool. These custom surfaceparms are stored in a file called ‘custinfoparms.txt’ in the folder scripts/. An example of this file with the new surfaceparm treacle and surfaceparm grass is shown below.
// Custom Infoparms File
NOTE: For linux users, when using the -custinfoparms parameter q3map first looks in your homedir, and only if it doesn't find a custinfoparms.txt there, it uses the one stored in the
quake3 install dir (usually /usr/local/games).
Contents flags are flags similar to CONTENTS_FOG in the original Q3A. These flags define the contents of volumes inside the game (for instance lava, fog, water, etc.).
If you look in the source file game/surfaceflags.h, it has defines for all contents flags. The define is split into a name and a hexadecimal value, for instance CONTENTS_PLAYERCLIP 0x10000. These hexadecimal values are powers of 2 and can be ored together (binary) to form a bit mask. Up to 32 contents flags can be ored together this way.
Example: creating a volume with treacle.
The following outlines how a custom contents flag can be added and used in a mod. First open the ‘custinfoparms.txt’ file and add ‘treacle 0x4000’ to the Custom Contentsflags section as shown in the example file above (0x4000 is one of the unused values available for custom use). Next write a shader script which uses ‘surfaceparm treacle’. Apply this new shader to all sides of a brush in a test map. When you compile the map, add the -custinfoparms parameter to the command line following q3map.
Next, add CONTENTS_TREACLE 0x4000 to the source file game/surfaceflags.h in your mod. Now you can call the point contents function. If the point is inside the brush with the shader using the ‘surfaceparm treacle’ then the point contents call will return a bit mask with CONTENTS_TREACLE set. This can for instance be used to slow down player movement when a player is inside such a brush.
The surface flags are texture properties that often affect entities in contact with surfaces using such flags. The ‘surfaceparm metalsteps’ parameter from Q3A is a good example.
If you look in the source file game/surfaceflags.h, it has defines for all surface flags. The define is split into a name and a hexadecimal value, for instance SURF_NODAMAGE 0x1. These hexadecimal values are powers of 2 and can be ored together (binary) to form a bit mask. Up to 32 surface flags can be ored together this way.
Example: Making ‘footsteps on grass’ sounds
The following outlines how a custom surface flag can be added and used in a mod. First open up the ‘custinfoparms.txt’ file and add 'grass 0x80000' to the Custom Surfaceflags section as shown in the example file above (0x80000 is the first available unused value in surfaceflags.h for surface flags). Next write a shader script which uses a grass image and has 'surfaceparm grass’. Create a test map with the grass shader covering the ground surface. When you compile the map, add the -custinfoparms parameter to the command line following q3map.
Next, add SURF_GRASS 0x80000 to the source file game/surfaceflags.h in your mod. Now you'll be able to execute a trace and the trace information will be returned in the trace_t structure. If the trace hits a surface with the grass surfaceparm then the SURF_GRASS flag will be set in trace_t->surfaceFlags. Such a trace can be used to trigger playing a sound of a person stepping on grass. For a reference example, see the existing metal steps in the game code.