$lightmap: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Revert thunder's edit; entity names must have underscores, not spaces)
mNo edit summary
Line 8: Line 8:
<li>For already-compiled maps, the lightmaps are stored as [[PPL]] files. These can be converted to [[VTF]] using [https://cdn.discordapp.com/attachments/235121530609205249/797996930956656680/proptexelvtf.exe Ficool2's proptexelvtf.exe (direct download)].
<li>For already-compiled maps, the lightmaps are stored as [[PPL]] files. These can be converted to [[VTF]] using [https://cdn.discordapp.com/attachments/235121530609205249/797996930956656680/proptexelvtf.exe Ficool2's proptexelvtf.exe (direct download)].
</ul>}}
</ul>}}
{{modernConfirm|If {{code|$lightmap}} is used to manually define lightmaps for a {{ent|prop_static}}, it may be necessary to disable vertex lighting for the prop ({{code|disablevertexlighting}}) to prevent [[VRAD]] from wasting time calculating lighting for the prop and generating a [[VHV]] file that will ultimately go unused and waste space.}}


==VMT syntax==
==VMT syntax==

Revision as of 10:10, 1 February 2024

Stub

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

$lightmap is a s2 available in Source 2013 Multiplayer Source 2013 Multiplayer and Garry's Mod Garry's Mod.

Warning.pngWarning:
  • The {{{game}}} parameter is inconsistent with the name defined by the {{Source 2013 MP}} template. This can most likely be fixed by setting the value of the {{{game}}} parameter to Source 2013 Multiplayer.
    If a parameter is consistent but you're still seeing this warning, it may be an issue with the template itself. Please discuss it on the template's talk page.

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 and skin).

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.
  • For already-compiled maps, the lightmaps are stored as PPL files. These can be converted to VTF using Ficool2's proptexelvtf.exe (direct download).
Confirm:If $lightmap is used to manually define lightmaps for a prop_static, it may be necessary to disable vertex lighting for the prop (disablevertexlighting) to prevent VRAD from wasting time calculating lighting for the prop and generating a VHV file that will ultimately go unused and waste space.

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.