Shader Changes
Mapbase comes with custom versions for most of the Source engine’s shaders. These changes are intended to be objective in nature, and ideally, they would maintain a near-identical appearance to the original games. Their main purpose is to fix issues and introduce optional features that mappers would benefit from, but would normally be unable to implement themselves.
Projected textures
Main article: Projected Textures
Mapbase overhauls projected textures to function similarly to later Source games. To fix most of their issues, Mapbase uses shader code originating from the Alien Swarm SDK, snippets from the Valve Developer Community, and the original G-String code release. See the main article for more information.
Radial fog
Mapbase uses radial fog, a fog calculation method which draws fog as if it were surrounding the camera. Normally, Half-Life 2 uses “planar” fog, which is calculated as a flat square that always faces the camera. You could often see past it by rotating the camera and looking at the edge of your screen.
Radial fog was introduced in Left 4 Dead and has been used in all Valve games ever since. Mapbase used Half-Life 2: Downfall’s repo as a guide for porting the involved shader code from the Alien Swarm SDK.
Brush phong (phong on LightmappedGeneric)
“Brush phong” means phong reflections on brush shaders like LightmappedGeneric. It highlights regions of a surface when it’s lit by a projected texture. This effect originated from City 17: Episode One and you could find more information on their ModDB page.
Parallax Corrected Cubemaps
Mapbase adds parallax corrected cubemaps, a technique implemented by Brian Charles and popularized by this video. It was implemented in Mapbase through this VDC article. In order to use parallax corrected cubemaps, you must create a parallax_obb brush entity filling in the entire room. The brush must be a box. You then go to the env_cubemaps you wish to be parallax corrected and add your new parallax_obb entity to the “Cubemap Bounds” keyvalue.
Tree sway
Mapbase adds support for $treeSway, a special feature introduced in Left 4 Dead and used in all Valve games ever since. It allows trees to “sway” with the wind. Some existing tree models have been given additional skins which use $treeSway. Mapbase used Half-Life 2: Downfall’s repo as a guide for porting the involved shader code from the Alien Swarm SDK.
Miscellaneous
$blendmodulatetexturenow appears under a flashlight, works with transforms, and shows up in Hammer. It also uses the Alien Swarm SDK’s version of the shader code.$phongdisablehalflamberthas been ported from Alien Swarm, allowing$phongto be used without$halflambertbeing forced enabled.$basetexturetransform2is now supported in DX9, allowing$basetextureand$basetexture2to be transformed independently. To avoid breaking compatibility, it only functions if you define$basetexturetransform2 "center .5 .5 scale 1 1 rotate 0 translate 0 0"in your material first. It also doesn’t work with$seamless_scaleor the C17:EP1 brush phong.
