User:SirYodaJedi/Porting IdTech 3 maps to Source/Shader2VMT

From Valve Developer Community
Jump to navigation Jump to search

Some miscellanea for the User:SirYodaJedi/Porting IdTech 3 maps to Source#Converting materials section that would bloat the page if put there.

Per material

SurfaceParm commands

alphashadow

This uses the alpha channel of q3map_lightImage to cast texture shadows.

nolightmap

Lightmaps are not generated for this material. This does not necessarily mean the surface is unlit; it still per-vertex lighting calculated for it unless q3map_noVertexLight is used (but whether they are actually used depends upon if rgbGen vertex is used, afaik)

Q3Map_* commands

q3map_alphaGen const <norm>

$alpha <norm>

q3map_lightImage <texturepath>

This is used for texlight color, bounced light reflectivity, and texture shadows (both opaque and color-tinted). If the lightImage texture is a JPG, then <texturename>_alpha.jpg should be treated as the alpha channel, if present.

q3map_noFog

$nofog

q3map_normalImage <texturepath>

This is a normal map, which is used to create shadows when baking lightmaps, simulating bumpmapping. Source supports real bumpmapping (which looks a lot better when interacting with dynamic lights), so go ahead and use this as a $bumpmap.

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

Like detail props. Annoyingly, VBSP has a bug that makes %detailtype not work correctly on brushes 99.9% of the time, so you might want to either take the time to convert the geometry to displacements (which it might need to be anyway for blended textures), or place prop_static or prop_detail entities manually.

Texture-related stuff

noMipMaps

Set the "no mipmaps" flag in the applicable VTFs

noPicMip

Set the "No LoD" flag in the applicable VTFs

noTC (in JK2, JA)
noCompress (in WolfET)

Don't use DXTn texture compression when creating the applicable VTFs (use BGR565, BGR888, or BGRA8888)

allowcompress (in WolfET)

Use DXT1 or DXT5 texture compression when creating the applicable VTFs, even if you are making most of the VTFs uncompressed

WolfET "implicit" materials

Wolfenstein Enemy Territory has some parameters that can be used as a shorthand for materials with only a diffuse map and lightmap, instead of defining all the texture stages for a material. These either contain a texture path, or use -, which uses the name of the material as the texture path. If you're curious how these work in WolfET, see this pastebin.

implicitMap <texturepath>

Material is opaque; no additional VMT parameters necessary.

implicitMask <texturepath>

Material is alpha-tested and backface culling is disabled; use $alphatest, $alphatestreference 0.5, and $nocull.

implicitBlend <texturepath>

Material is alpha-blended and backface culling is disabled; use $translucent and $nocull


Other

qer_editorImage <texturepath>

This is roughly equivalent to %tooltexture, although it differs slightly in that it can also be used in the 3D view for alignment purposes.

cull none
cull disable

$nocull

deformVertexes autoSprite

$spriteorientation VP_PARALLEL

deformVertexes autoSprite2

$spriteorientation VP_PARALLEL_ORIENTED

Per texture stage

map

This is the texture. It may be any sort of texture, not necessarily just a diffuse texture.

clampMap

Like `map`, but clamps the UV coordinates to prevent usage as a tiled texture. Set these in the VTF.

animMap

Like `map`, but animated. The number before the texture list indicates the frame rate. Combine these into a single VTF and use a material proxy to set the animation. Up to 8 frames in vanilla Quake III. Up to 16 frames in vanilla RTCW and WolfET. Up to 32 frames in vanilla Jedi Academy.

clampAnimMap

Like clampMap and animMap combined. Not in vanilla Quake 3.

videoMap

Like `animMap`, but uses a ROQ video file instead of defining a set of individual image files. This allows for much longer animations, but lacks an alpha channel. Use ffmpeg -i input.roq out%03d.png to extract all the frames from the ROQ, and ffprobe input.roq to determine the original framerate.

blendFunc

Can blend textures together (detail textures, glowing textures, etc.), be used for translucency, or even do specular lighting, depending upon parameters and stage position.

alphaFunc

Alphatesting. Unlike Source, Quake III supports alpha-clipping translucent textures. Any textures with translucency will need to not have alpha-testing when ported to Source, and may need to be edited (to sharpen the alpha channel). It takes one parameter:

Parameter Description VMT equivalent and additional setup
GT0 Greater Than 0.

Usually used in conjunction with a translucent blendFunc, to avoid rendering the surface where completely transparent.

If not translucent (rare):
LT128 Less Than 128.

This designates an inverted alpha channel.

If not translucent:

First invert the alpha channel in an image editor (linear invert).

GE128 Greater than or Equal to 128.

Standard alpha testing; anything less than 127 will be transparent, and anything greater than or equal to 128 will be opaque.

If not translucent:
GE192 Greater than or Equal to 192.

Added in Jedi Academy. Like GE128, but with the clipping threshold set to 192

If not translucent: