$lightmap

From Valve Developer Community
Revision as of 09:59, 7 August 2023 by Popcorn (talk | contribs) (Added category sorting key.)
Jump to navigation Jump to search

Stub

This article or section is a stub. You can help by expanding it.

$lightmap is a material shader parameter available in Source 2013 Multiplayer Source 2013 Multiplayer and Garry's Mod Garry's Mod for VertexLitGeneric. It defines a lightmap to be used to light the MDL model's material, instead of the per-vertex lighting used by prop_static or point lighting used by other models.

This parameter does not usually need to be added manually, as VRAD will generate model lightmaps automatically if generatelightmaps is enabled for the prop_static and -StaticPropLighting is enabled in VRAD. Nonetheless, it can still be added manually, such as for using a lightmap on a prop_dynamic, or if a prop_static has multiple materials (as VRAD can only generate lightmaps for the first material.

Tip.pngTip:Source 2013 Multiplayer VRAD has a -dumppropmaps option, which will create external TGA versions of the generated static prop lightmaps which can be converted to VTF and manually defined as a $lightmap.
Todo: What about converting static prop lightmaps from already-compiled maps? They are stored as PPL files, which have a slightly different header from VTF or TGA.

VMT syntax

$lightmap <texture>
models/lightmapped/example.vmt
vmt
VertexLitGeneric { $basetexture "models/lightmapped/example_base" $lightmap "models/lightmapped/example_lightmap" }

Limitations and caveats

Note.pngNote:Archived rest of page history of page template:warning model lightmaps
Icon-Important.pngImportant:These pages are linked often from page history logs so Special:WhatLinksHere will not show anything.