Nuclide
Software Development Kit for id Tech
Materials: VMap Commands

The following commands are alter specific behaviour during the BSP compilation process. These are not respected by the engine, the renderer or the game-logic.

vmap_backmaterial

Syntax

vmap_backMaterial <material>

Overview

This allows a brush surface to use a different material 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.

vmap_backMaterial only works on brush faces. For this reason, it is often deprecated in favor of using [vmap_cloneMaterial](vmap_cloneMaterial) where the target material contains [vmap_invert](vmap_invert).

It can still be useful as a kind of shorthand.

vmap_backsplash

Syntax

vmap_backsplash <percent> <distance>

Overview

Controls the percentage of [surface light](vmap_surfaceLight) backsplash (how much light the emitting surface hits), as well as the distant away from the surface of which it is cast. This is really tricky to get right in tight areas, so put time aside to experiment.

The default backsplash amount is 5%, and the default distance is about 16 units.

vmap_basematerial

Syntax

vmap_baseMaterial <material>

Overview

Copies the vmap_/surfaceparm commands from the specified material into this one.

However, if you want to copy the appearance and only specify compiler-specific modifications, use [vmap_remapMaterial](vmap_remapMaterial).

vmap_bounce

Syntax

vmap_bounce <scale>

Overview

Specifies the fraction of light to re-emit during a bounce pass on this surface.

vmap_clonematerial

Syntax

vmap_cloneMaterial <material>

Overview

A material with this directive will inherit the target material's properties and appearance. Be careful, this can lead to an infinite loop if a cloning material references another cloning material or itself.

vmap_invert

Syntax

vmap_invert

Overview

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 material that is targeted by [vmap_cloneMaterial](vmap_cloneMaterial) for something similar to [vmap_backMaterial](vmap_backMaterial).

vmap_lightimage

Syntax

vmap_lightImage <texturepath>

Overview

By default, surface lights use the average color of the source image to generate the color of the light. vmap_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. vmap_lightImage should appear before qer_editorImage.

vmap_lightmapfilterradius

Syntax

vmap_lightmapFilterRadius <lightmap filter radius> <light filter radius>

Overview

This is usually used on [light emitting materials](vmap_surfaceLight) to approximate finer subdivided lighting. It adds a gaussian blur effect to the lightmaps of either the material itself, or the surfaces affected by the material, or both. The values for **<lightmap filter radius>** and **<light filter radius>** are measured in world units of filtering (blurring) of lightmap data cast by any light sources.

**<lightmap filter radius>** Amount of blur set for the material itself to approximate for the [surface light's](vmap_surfaceLight) finer subdivided lighting. It should be set to 0 for sky materials since they don't have lightmaps.

**<light filter radius>**: Amount of blur set for other surfaces affected by this material's emitted light. It should be set just high enough to eliminate the "stadium shadow" effect sometimes produced by [light_environment](light_environment) or to smooth out the lighting on [surface lights](vmap_surfaceLight).

[vmap_lightmapFilterRadius](vmap_lightmapFilterRadius) should be placed before any light related material directives that you want it to affect.

vmap_lightmapmergable

Syntax

vmap_lightmapMergable

Overview

When specified, the compiler will attempt to merge all surfaces using this material together onto lightmap sheets. This can drastically reduce the artifacts occuring on surfaces like terrain where precision issues might get you black spots along the lightmap seams. Definitely use this across large collections of surfaces on which you expect smooth transitions.

vmap_lightmapsampleoffset

Syntax

vmap_lightmapSampleOffset <float>

Overview

Takes a single parameter, defaulting to 1.0, which specifies how many units off a surface should the compiler 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 vmap_lightmapSampleOffset as a last resort.

vmap_lightmapsamplesize

Syntax

vmap_lightmapSampleSize <int>

Overview

Surfaces using a material 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 sample size is 8, smaller numbers increases lightmap resolution. In general, you should stick with power of 2 values.

vmap_lightrgb

Syntax

vmap_lightRGB <red color> <green color> <blue color>

Overview

Alternative to [vmap_lightImage (Material Command)](vmap_lightImage) and the automatic way of figuring out which light color a specified surface emits.

vmap_lightsubdivide

Syntax

q3map_lightSubdivide <units>

Overview

Used on surface lights (see [vmap_surfaceLight (Material Command)](vmap_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 lightmap generation.

vmap_nodirty

Syntax

vmap_nodirty

Overview

This surface is not affected by dirt-mapping. The compiler baked variant of ambient occlusion.

vmap_offset

Syntax

vmap_offset <float>

Overview

Offsets a surface along the vertex normals by N.N units. Used in celshading for those black edges. This is the sort-of the compiler version of [polygonOffset](polygonOffset)

vmap_remapmaterial

Syntax

vmap_remapMaterial <material>

Overview

Allows the material to later become known as the specified material.

These materials should not contain anything but compiler-specific keywords.

For example, if you want a material that is **exactly like'' the specified**vmap_remapMaterial**in appearance, but with a specific**vmap_''' or surfaceparm characteristics, use this command.

However, if you want want just a material's vmap_/surfaceparm properties, use [vmap_baseMaterial](vmap_baseMaterial).

vmap_shadeangle

Syntax

vmap_shadeAngle <degrees>

Overview

In short: At which angle the phong shading on a material breaks. If you set it to 0, basically no phong shading will ever be performed. The default shade angle in [VMAP](VMAP) is 40 degrees.

vmap_surfacelight

Syntax

vmap_surfacelight <intensity>

Overview

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 [vmap_lightImage](vmap_lightImage) or [vmap_lightRGB](vmap_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.

If you want to change the distance/range of the surfacelight, use [vmap_surfacelightDistance](vmap_surfaceLightDistance).

vmap_surfacelightdistance

Syntax

vmap_surfaceLightDistance <scale>

Overview

Increases the range of a surfacelight. This is different from increasing the [vmap_surfaceLight (Material Command)](vmap_surfaceLight) value, as it'll travel much wider without affecting the total intensity of the light.

vmap_surfacemodel

Syntax

vmap_surfaceModel <modelpath> <density> <odds> <minscale> <maxscale> <minangle> <maxangle> <oriented>

Overview

A surface with vmap_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.

This will bake the models into the .bsp itself, creating an unnecessarily inflated map. Use [fte_clutter (Material Command)](fte_clutter) instead.

vmap_tesssize

Syntax

vmap_tessSize <amount>

Overview

Formely known as just tessSize.

The command 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](deformVertexes) keyword.

Abuse of this can create a huge number of triangles. This happens during BSP processing, so maps must be reprocessed for changes to take effect.

Note

It can also be used on tesselating surfaces to make sure that tesselations are large, and thus, less costly in terms of triangles created.