VertexLitGeneric Textures On Brush Faces: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(First stab at transitioning this from the Help Desk. Probably needs a glance over from someone more familiar with their VMTs, etc.)
 
(Rewrite Template:Lang to Template:LanguageBar. This action was performed by a bot.)
 
(14 intermediate revisions by 11 users not shown)
Line 1: Line 1:
Materials that use the [[VertexLitGeneric]] shader may render incorrectly when applied to brush faces. If your lightmaps flicker or are displayed full black, you may have used one of these. They are listed in Hammer in the <code>props/</code> or <code>models/</code> directory. Look for equivalent materials with the same name that are not in these directories. These materials will render correctly.
{{LanguageBar|{{PAGENAME}}|title=<code>VertexLitGeneric</code> Textures on Brush Faces}}
== Issue ==
Materials that use the {{ent|VertexLitGeneric}} as their [[Shader Types and Parameters|shader]] will render incorrectly when applied to brush faces, which require lightmapped materials. If the [[lightmap]]s flicker, the brightness changes relative to where the player views the texture, or the face is displayed full black, a vertex lit material is likely to have been used. Materials listed in Hammer in the <code>models/</code> directory are all vertex lit, and should not be used on brushes, but they may not be the only textures with this shader. The <code>decals/</code> directory also contains vertex lit materials, and should not be used on brush geometry.


[[Category:Level Design FAQ]][[Category:Materials]]
== Fix ==
The easiest fix is to look for equivalent materials with the same name that are not in these directories. These materials will render correctly as they use the correct shader.
 
Another approach is to write a new [[VMT]] that changes the shader to {{ent|LightmappedGeneric}}, the <code>.vmt</code> will need to be copied out of the [[GCF]] file first and given a new name. Further instructions on writing and editing a <code>.vmt</code> can be found in the [[Material]] tutorial, the [[VTF]] is already included with the game so the first part of the tutorial may be skipped.
 
{{tip|Remember to distribute the <code>.vmt</code> with the map. Without the VMT file, the [[Invalid Texture|texture is invalid]] and will appear as pink & black checkers in-game.}}
{{tip|Use {{ent|%notooltexture}} to hide a material in {{hammer|2}} if it shouldn't be used on brushes or displacements and is located outside of the {{path|models/}} subdirectory.}}
 
== Examples ==
{{Todo|Get some pictures of classic examples}}
[[Category:Level Design FAQ]][[Category:Material System]]

Latest revision as of 17:42, 18 July 2025

English (en)한국어 (ko)Translate (Translate)

Issue

Materials that use the VertexLitGeneric as their shader will render incorrectly when applied to brush faces, which require lightmapped materials. If the lightmaps flicker, the brightness changes relative to where the player views the texture, or the face is displayed full black, a vertex lit material is likely to have been used. Materials listed in Hammer in the models/ directory are all vertex lit, and should not be used on brushes, but they may not be the only textures with this shader. The decals/ directory also contains vertex lit materials, and should not be used on brush geometry.

Fix

The easiest fix is to look for equivalent materials with the same name that are not in these directories. These materials will render correctly as they use the correct shader.

Another approach is to write a new VMT that changes the shader to LightmappedGeneric, the .vmt will need to be copied out of the GCF file first and given a new name. Further instructions on writing and editing a .vmt can be found in the Material tutorial, the VTF is already included with the game so the first part of the tutorial may be skipped.

Tip.pngTip:Remember to distribute the .vmt with the map. Without the VMT file, the texture is invalid and will appear as pink & black checkers in-game.
Tip.pngTip:Use %notooltexture to hide a material in Hammer Hammer if it shouldn't be used on brushes or displacements and is located outside of the 🖿models/ subdirectory.

Examples

Todo: Get some pictures of classic examples