-
Notifications
You must be signed in to change notification settings - Fork 151
Shader Changes
Mapbase modifies the shaders in various ways, but these changes aren't meant to improve graphical quality as much as they're meant to fix bugs or "improve the mapping experience".
Before we actually get into what these changes are, we need to talk about the caveat of modifying existing shaders:
The Source SDK comes with the original shader source code and files which you could compile yourself, but Source doesn't actually allow modders to change existing shaders for security reasons. You can create new shaders with code from existing shaders, but you can't actually modify existing shaders in the engine. This means you can't add things to the existing LightmappedGeneric
, but you can create an identical shader called SDK_LightmappedGeneric
with your own changes. This is how Mapbase modifies the shaders. It uses custom SDK_
versions of the original shaders.
The problem is that materials still using the original shaders won't use Mapbase's shader changes, so in order to take advantage of these changes, you must change all of your materials to use the custom shaders.
This isn't too bad since it only needs the VMTs (plain-text material files) to be changed, not the VTFs (actual texture files). Mapbase also already comes with converted versions of all of Half-Life 2/EP1/EP2's VMTs, neatly packed in VPKs and staying at about 2-3 MB total, so you'd only have to worry about this if you're adding custom materials or mounting materials from another game. Mapbase also provides an "installer" that can automatically change all of the materials in a directory to the new shaders.
You could potentially get away with using the original shaders if you don't need Mapbase's shader changes, as there's nothing inherently wrong with them, but they wouldn't look right if they're used alongside modded shaders because features like radial fog and projected texture changes would make them look weird. Rope materials also require the SDK_Cable
shader due to some other code changes that make the original Cable
unusable.
These are the changes Mapbase makes with its custom shaders:
Mapbase uses Alien Swarm/City 17: Episode One projected texture changes from Insolence's repository. You can find more information on the dedicated article.
Mapbase uses Half-Life 2: Downfall's implementation of Alien Swarm's radial fog, as opposed to Half-Life 2's planar fog. This means fog is calculated radially and doesn't change as you rotate the camera.
Mapbase uses City 17: Episode One's phong on LightmappedGeneric, ported from Insolence's repository. I still haven't figured out what it's supposed to look like.
Mapbase uses Alien Swarm ropes from Half-Life 2: Downfall, including both the SplineRope shader and keyframe_rope itself.
Mapbase fixes $blendmodulatetexture not appearing under a flashlight, not working with transforms, and lets it show up in Hammer. It also uses Alien Swarm's shader code.
Mapbase ports this parameter from Alien Swarm, which allows $phong to be used without $halflambert.
-
Something Index
- Something special
- Something else